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

How to: Click on image in Cat view -> product details and Pop up Image there

Started by Lorrein, October 11, 2012, 10:56:09 AM

Previous topic - Next topic

Lorrein

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



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!