News:

Looking for documentation? Take a look on our wiki

Main Menu

When Clicking on Images

Started by craig182, June 22, 2012, 14:52:51 PM

Previous topic - Next topic

craig182

When clicking on product images in a category the images just get bigger. How do you have it so when the image is clicked it takes you to the product listing instead?

Thank you

srajca

in your default.php in category folder find this lineecho $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',false,'class="modal"'); and change it with this oneecho 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="featuredProductImage" border="0"',false) );
hope it helps, and make sure to do an override. then if it works mark this thread as solved.

craig182

Worked a treat, can't beat that for help. Thanks, man.

craig182

Also, no idea what you mean with override. I just replaced the code and it worked.

srajca

I don't recommend replacing the code because then you will lose the modifications you make with the next update. To do an override you simply have to do this;
1. go to your templates folder
2. open your current front-end template
3. create a folder named html if it doesnt exist already
4. create folder com_virtuemart
5 create folder of whatever override you would like to create - for example category for categoryy override, productdetails for productdetails, or you can just copy the original folders there and then modify them in the templates folder
6. modify your .php file
P.S. for modifying css just add the modified css classes or id's in your template css folder

so the path to the overridden default.php in category should look like this;
/templates/YOURTEMPLATE/html/com_virtuemart/category/default.php - note that you shouldn't add folder named views as in components of virtuemart
hope this clarifies it for you.