VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Lorrein on October 11, 2012, 10:56:09 AM

Title: How to: Click on image in Cat view -> product details and Pop up Image there
Post by: Lorrein on October 11, 2012, 10:56:09 AM
In category view, when you click on an image, it pops up by deafult.
In product details the image can not be clicked.

Personally I think that clicking on an image in Categorie view should just link to the product details page. And in Product details view, the image should popup and enlarge.
This is how you can do it: Of course you should use a template override

find /com_virtuemart/productdetails/default_images.php

change
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', true, "class='modal'", true); ?>

to
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', false, "class='modal'", true); ?>

find
templates/templatename/html/com_virtuemart/category/default.php

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

Change to
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));

Title: Re: How to: Click on image in Cat view -> product details and Pop up Image there
Post by: pjsban on November 27, 2012, 11:45:13 AM
It's very helpful to me. thanks a lot
Title: Re: How to: Click on image in Cat view -> product details and Pop up Image there
Post by: bytelord on November 27, 2012, 14:10:32 PM
also on the FAQ: http://forum.virtuemart.net/index.php?topic=98647.0