Hello all,
When a user views the category page, currently if he clicks on the product image a thumbnail image popup is shown.
The behavior that I want is that when a user clicks on the product image, he should be redirected to the product main page in the same way as if he clicks on the product title.
I see that this can be done by changing $href in the following line (administrator\components\com_virtuemart\helpers\mediahandler.php):
$lightboxImage = '<a '.$file_alt.' '.$effect.' href="'.$href.'">'.$image.'</a>';
What I like to do is to change $href with the product page URL, indeed I tried to substitute it with $product->link and $parent->link but both didn't work..
Anyone can help?
thanks too much!
HI,
You should not change core files of VM. You may achieve Your goal easily by template overwrite.
just put /components/com_virtuemart/views/category/tmpl/default.php
into /templates/[your template name]/html/com_virtuemart/category/default.php
line near 234
<a title="<?php echo $product->link ?>" rel="vm-additional-images" href="<?php echo $product->link; ?>">
<?php
echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
?>
</a>
remove rel="vm-additional-images"
Hello, thank you..
After your suggestion to substitute the files, I didn't find "rel=vm-additional-images" you mentioned.
I tested anyway, but I still get the same behavior so that when clicking on the product's image on category page it goes showing me the thumbnail.
Here is the code that I have in /components/com_virtuemart/views/category/tmpl/default.php
// Show Products ?>
<div class="product floatleft<?php echo $Browsecellwidth . $show_vertical_separator ?>">
<div class="spacer">
<div class="width30 floatleft center">
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
?>
Thank you very much for your kind help!
Your VM version?
Hi
change this
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
?>
to this
<a title="<?php echo $product->link ?>" href="<?php echo $product->link; ?>">
<?php
echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
?>
</a>
Thank you very much for you kind help!!
It's working as expected :D
Kind regards,
Hi, I'm very interested to solve the same problem. I'm a bit confused about all the replays here. Please can you give me a summery what file I have to change and what the change should be. Thank you so much
Default action in the current version, VirtueMart 2.0.22e is for the images on the category display page to link direct to the product details and not popup an image. If you are using this version then that is what should happen unless you are using a Joomla template with out of date template override files.
Hi Kelvyn,
thank you for your reply.
How can I use the product_url in my shop. I like to link the image and product name to this product_url. Thanks for your help.
Use forum search button for finding already posted solution for this.
And product url is for product itself.
You'll use external images as general images.