VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: chosenanointed on November 15, 2011, 13:19:50 PM

Title: How to link thumbnails to Product Details?
Post by: chosenanointed on November 15, 2011, 13:19:50 PM
Does anyone know how I can change the thumbnails in Category View to go to the Product Details instead of showing the enlarged image?

I've changed the code in the view template a bit already to the way I want it to be laid out, but I don't know php very well and don't know how to change the code to make the thumbs go to the Product Details when clicked on.

I guess the part that needs to be edited is this:
/components/com_virtuemart/views/category/tmpl/default.php
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage category-img-thumb" border="0" title="'.$product->product_name'" ',true,'class="modal"') ;
?>


I've added an extra class in there to give the images a border, but I don't know what to do to change the way it links. As I said, I really don't know php much.

Please help!?
Title: Re: How to link thumbnails to Product Details?
Post by: PRO on November 15, 2011, 14:49:26 PM
http://forum.virtuemart.net/index.php?topic=90935.msg299146#msg299146
Title: Re: How to link thumbnails to Product Details?
Post by: chosenanointed on November 15, 2011, 14:55:36 PM
Thanks, you're awesome! I actually looked at that discussion but missed that part.

Title: Re: How to link thumbnails to Product Details?
Post by: BaidareW on March 11, 2012, 08:43:00 AM
Hello,

I see that solution is somewhere here :) but I still don't do it right. In my opinion the default way should be opening product detail instead of image popup.

From link to another post I find that I need to add :

"Link the picture to the flypage from the category Page"
<?php echo JHTML::_('link'JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="browseProductImage" border="0"',false)); ?>


But where to put this exactly ? I edit file default.php in category/tmpl/ and put this text instead of
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
?>



Thanks for your answer - I understand how important is time that you give to us!