VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: PreFollower on June 11, 2012, 13:49:51 PM

Title: Turn off all lightboxes
Post by: PreFollower on June 11, 2012, 13:49:51 PM
Hi.

Maybe someone think that all that lightboxes are great, but I think that if you click product image in category you want to see product page, not lightbox.
So, is there any way to:
1. Turn product images in category into simple links to product page
2. Turn off lightbox for additional images on product page, and replace big image with additional instead?

I hope there are just some checkboxes somewhere, but I expect to rip apart templates and use javascript.
Title: Re: Turn off all lightboxes
Post by: srajca on June 11, 2012, 15:02:48 PM
I just did that today for my template ;)
Go to templates/YOUR TEMPLATE/html/com_virtuemart/category/default.php and find this code - it should be around line 220.
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',false,'class="modal"');

and change it with this one
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="featuredProductImage" border="0"',false) );

This will remove the lightbox and when you click on the image it will redirect you to your product description page.
Hope it helps
Title: Re: Turn off all lightboxes
Post by: PreFollower on June 11, 2012, 15:06:30 PM
Thanks, it solved first problem.

Now what about second? I still need to replace big image on click.
Title: Re: Turn off all lightboxes
Post by: srajca on June 11, 2012, 15:23:07 PM
to change big image to small go to templates/YOUR TEMPLATE/html/com_virtuemart/productdetails/default_images.php nad search for the following at about line 26
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"'false"class='modal'"true); ?>
and just change displayMediaFull with displayMediaThumb that is a couple of lines lover. I am not 100% sure but this should do the trick, and in order to turn of the lightbox I think you have to set some of the parameters that are true to false. Hope it helps
Title: Re: Turn off all lightboxes
Post by: PreFollower on June 11, 2012, 19:35:51 PM
This will make one more small image which is similar to first additional. But I need big image to change when you click on small.

So if you have, for example, two images for product. When you open product page there will be one big image and two small. If you click small, lightbox will show up. But I want big image to change into clicked instead of this.
Title: Re: Turn off all lightboxes
Post by: nitg on July 23, 2012, 14:45:48 PM
hello!
i am looking also for a function to change the big picture, when you click on a small one...
Title: Re: Turn off all lightboxes
Post by: GomHang on May 23, 2013, 18:28:02 PM
thanks, I also have just solved this problem  :)
Title: Re: Turn off all lightboxes
Post by: Studio47WebDesign on July 16, 2014, 02:56:04 AM
How did you fix this? I want to disable Lightbox in Product Display and just have all the thumbnails open in the large product image place. Please help.
Title: Re: Turn off all lightboxes
Post by: jenkinhill on July 16, 2014, 10:44:34 AM
In VM2.6.6 - does this do what you want?
Configuration/Templates/Media Files Settings/Open additional images on main position