News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Remove link from product thumbnail

Started by gofer123, May 10, 2012, 23:44:47 PM

Previous topic - Next topic

gofer123

Hi,
I have VM2 running in Joomla 2.5 and I can't find where I remove the link from the product thumbnail, I want the TN image to remain but I want the viewer to only be able to click on the "Product Details" button.
Would be grateful if someone could tell me how this is done, I've had a good look and tried a few things but haven't been able to crack it.
Thanks.

rheo

did you manage to figure out how to remove the link?

bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rheo

#3
After 2 days and hours and hours of looking... I didnt find anything close to solving the problem of how to

Remove the Image Link under Product Detail Page.


I finally found out where this link switch resides... Its not in the template view or the product detail page..

Mod Edit:
administrator/components/com_virtuemart/helpers/image.php

There is a function for  Displaymediafull in the beginning..

Change from True to False..

.... function displayMediaFull($imageArgs='',$lightbox=false,$effect ="class='modal'",$description = true ){  ....

After you set to false, the link will disappear.

bytelord

There is no reason to hack the core for that, adjust it to your template files  :o
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rheo

There is no way to remove the link of the image from the administration of the template or from Virtuemart


bytelord

#6
There is a very simple way.

For example for category view, inside category/default.php around line 239 we have:

echo $product->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' . $product->product_name . '" ', TRUE, 'class="modal"');

Change it to:

echo $product->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' . $product->product_name . '" ', FALSE, 'class="modal"');


only change to FALSE from TRUE when calling displayMediaThumb for the url ... so simple...

Are you familiar with template overrides?? Have you take a look on the forum??

Use firebug to examine you site code and css styling: https://forum.virtuemart.net/index.php?topic=102850.0

Template Overrides:
Creating Template overrides: https://forum.virtuemart.net/index.php?topic=98505.0
Template System: https://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system

EXAMPLE:

To create a template override for category view:  joomla_root_folder/components/com_virtuemart/views/category/tmpl/default.php

Just copy that file under joomla_root_folder/templates/your_joomla_template/html/com_virtuemart/category/default.php
If the folders are not exist please create them ... if you already use template overrides edit the overridden file.

Place your changes inside there!


Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rheo

I'm not talking about the Category Page.
That is not a problem.


Its the product detail page.

The image is linked to itself.

bytelord

Then,

Edit create an override for the default_images.php under productdetails and make there your changes ...

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rheo

There isnt anythign in default images that allow me to remove the link

/ Product Main Image
if (!empty($this->product->images[0])) {
    ?>
    <div class="main-image">
   <?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', false, "class='modal'", true); ?>
    </div>
<?php } // Product Main Image END ?>

<?php
// Showing The Additional Images
// if(!empty($this->product->images) && count($this->product->images)>1) {
if (!empty($this->product->images) and count ($this->product->images)>1) {
    ?>
    <div class="additional-images">
   <?php
   // List all Images
   if (count($this->product->images) > 0) {
       foreach ($this->product->images as $image) {
      echo '<div class="floatleft">' . $image->displayMediaThumb('class="product-image"', true, 'class="modal"', true, true) . '</div>'; //'class="modal"'
       }
   }
   ?>
        <div class="clear"></div>


Please lemme know. Thanks! Perhaps its something i am missing or have not much knowledge of thanks..

bytelord

???

Your mail image does not have a link because you are using displaymediafull...
you mean the additional images?? What are you trying do to!! I cannot understand you... sorry
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rheo

Its already done as i have mentioned on the first part...
haha

Product Detail Page.

There is a image for your product.

I do not want any link on that image. No link, no popup and no lightbox.
I dont want people to click the image

bytelord

When using disaplaymediafull no one cannot click on the image, on the other hand place a false in the area i suggest ... still cannot understand, tests both and there isn't any "link" the user to clicks on...  :o
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

ronniestamps

I know this is over 6 months old but the original question was left unanswered. The same issue brought me here.

To remove the link attached to the main product image:

1. Open file administrator/components/com_virtuemart/helpers/mediahandler.php
2. Within the function displayIt (around line 576) find code around line 589 that reads: $lightboxImage = '<a '.$file_alt.' '.$effect.' href="'.$href.'">'.$image.'</a>';
3. Change the line of code to read: $lightboxImage = $image;

That's it!

BTW - there should absolutely be a setting to change this without code hack...IMHO