VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: scotous on December 31, 2011, 13:56:39 PM

Title: Virtuemart 2 (product page) & Lightbox
Post by: scotous on December 31, 2011, 13:56:39 PM
Hello all,

I have noticed something , i do install virtuemart 2 in joomla 1.7 but although i even try this to many servers I cant get lightbox to work when in Productdetails page.

Lightbox work in categories images and in category also (sthg worse than it was as the old virtuemart had a link to the product or category and not lightbox)
But i cant track any lightbox in the product page.

I have also noticed that now there arent any flypages but the default.php as template for each view.

Is virtuemart 2 that way or i am doing sthg wrong?
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: Ducksoul on December 31, 2011, 17:08:04 PM
In standard layout the first productimage of a product does not use a lightbox. If you add more than one image to a product the additional images should use the lightbox function.

In virtuemart 2 there aren't any flypages. To adapt the themes you can use overrides.

Just copy the file you want to edit and place it in templatefolder/html/com_virtuemart/name_of_view. If you want to have more than one view (e.g for categories) just rename the default.php. Later you can choose the view that should be used in backend of vm2.

For example if you want to adapt the category browse view just copy the default.php from
"components/com_virtuemart/views/category/tmpl/default.php" to "templatefolder/html/com_virtuemart/category/" and adapt it to your needs.

For further information look at: http://forum.virtuemart.net/index.php?topic=90935.0
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: scotous on December 31, 2011, 19:44:15 PM
Dear Ducksoul,

Thank you for your post; especially this day of the year!

I had read the post you attached before i open a new post.

I know that flypages are long gone and that now a default view is only available but what i want to know is if or how a lightbox can be attached to main image.

What i surely know is that the main image default php does not produce lightbox "<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',false) ?>"

but the additional images display php "<?php // List all Images
         foreach ($this->product->images as $image) {
            echo $image->displayMediaThumb('class="product-image"',true,'class="modal"',true,true); //'class="modal"'
         } ?>" produce.

What i have only managed to achieve is that if the php of the main image php is "<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',true,"class='modal'",true); ?>" then i have at least a link with the image. but i cant find where to add the rel to this image to be lightbox.
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: scotous on December 31, 2011, 20:30:00 PM
I have actually found where the problem was and without knowing if anything else will turn bad i can say 100% that if you change the file image.php in administrator/component/com_virtuemart/helpers
line: 87
"return $this->displayIt($file_url, $file_alt, $imageArgs,$lightbox,'',$postText);"
to
"return $this->displayIt($file_url, $file_alt, $imageArgs,$lightbox,$effect,$postText);"

and the default.php of the productdetails to main image display line 105-107~: "<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',true,'class="modal"',true,true) ?>"
         

Then the main-image will work in lightbox.
hope helped some people!
happy new year everyone!
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: charles99 on January 01, 2012, 01:27:56 AM
Scotous fixed really do work! I was just getting ready to dive into the lightbox issue...

good job!
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: idemsisvoje on January 05, 2012, 00:58:43 AM
scotous your solution really works, thank you for that.
anyway, there is one more thing about lightbox gallery..lightbox doesn't display previous/next links, you have to close current image and then click another one.
i guess it is caused by missing rel="something" attribute in image link, i.e. images are not grouped in image set. if i add rel="something", the image wont open in lightbox, instead it opens in current window.
this little missing functionality might be quite distracting for a visitor in my opinion.

could anyone please help me to get it right?
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: scotous on January 05, 2012, 09:08:47 AM
To: idemsisvoje,

Yes that does appear to happen and what i understood is that the lightbox that vm use has different coding than the lightbox. so rel="group" doesnt mean anything and it just breaks everything.

I have tried a workaround and that is working with fancybox plugin for joomla.

It is free you can install it at joomla and adjust it. The only problem there is that you don't have the overlay effect. It doesn't work on me at least.

Try it and tell me how did that work.
It's working on me.
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: idemsisvoje on January 05, 2012, 16:27:15 PM
Thanks for the tip on fancybox Scotous.
I tried it, but it displayed images, as you mentioned, without overlay effect. I could live without that, but clicking next to images doesn't close the gallery, which wasn't acceptable at all for me.

I finally solved it by implementing original Lightbox2 script, and everything works just as it should. Here is the download link with set up quide.

http://lokeshdhakar.com/projects/lightbox2/ (http://lokeshdhakar.com/projects/lightbox2/)

I was surprised, how easy it was to set up.

Give it a try and let me know, if it's OK.
Cheers
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: scotous on January 05, 2012, 16:35:07 PM
Lightbox should work well, i havent tried it yet but i suppose that it should work well indeed.

The only problem is that by adding lightbox i presume that you on the long term you will have a "heavy" website with many scripts. Imagine a site with lbox a flash slideshow a virtuemart, some flash modules etc.. i think it will be a nightmare.

After i finish with some other issues i ll try to see what is the right coding for modal.

(have in mind that if u choose to load lightbox modal.js will still load so if one achieves to make modal to work its the best thing to do)
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: idemsisvoje on January 05, 2012, 16:52:23 PM
You are right, fixing the defaul script is the best solution. But for now, I will try to turn modal off, so my website doesn't get heavy, while keeping Lightbox :)
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: kaleske on January 26, 2012, 16:21:34 PM
Hello fancybox plugin didn`t work for me. Can anybody help me?
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: Rinie Engelen on February 28, 2012, 11:26:34 AM
Hello to all,

I've done as follow:
Installed and activated the plugin 'shadowbox' (http://extensions.joomla.org/extensions/multimedia/multimedia-display/9220 (http://extensions.joomla.org/extensions/multimedia/multimedia-display/9220))
Then, in the override of the productdetail page, I changed the img-line:
<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',false,"class='modal'",true); ?>
into:
<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',true,'rel="shadowbox"',true,true); ?>

To see more pictures you can add the image foldername like:
<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',true,'rel="shadowbox[foldername]"',true,true); ?>


It worked for me.
And as you can see: there is a possibility to add a rel=...

I'm using Joomla vs 2.5.1
Virtuemart vs 2.0.2

Kind regards, Rinie Engelen
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: rupesh on April 05, 2012, 09:43:33 AM
Quote from: idemsisvoje on January 05, 2012, 16:27:15 PM
Thanks for the tip on fancybox Scotous.
I tried it, but it displayed images, as you mentioned, without overlay effect. I could live without that, but clicking next to images doesn't close the gallery, which wasn't acceptable at all for me.

I finally solved it by implementing original Lightbox2 script, and everything works just as it should. Here is the download link with set up quide.

http://lokeshdhakar.com/projects/lightbox2/ (http://lokeshdhakar.com/projects/lightbox2/)

I was surprised, how easy it was to set up.

Give it a try and let me know, if it's OK.
Cheers


can u please tell me steps to implement it ? on product detail page in virtuemart 2.0?
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: aminorart on April 29, 2012, 18:08:10 PM
Hello @rupesh

How were you able to fix your issue with the images displaying in lightbox? Was the Lightbox 2 install what fixed your problem? My product images are opening in a new window when I click on them. Any help from anyone would be very appreciative!
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: solwininfotech on April 30, 2012, 12:22:54 PM
hi

Go to this file media > system > js > modal.js on line number 9

Search for                  !SqueezeBox.fromElement(this,b)

Comment it like       /*!SqueezeBox.fromElement(this,b)*/  and than write after that
"return false"

This thing is work for me in VM 2.0.2 and Joomla 1.7


Try and check it . I think it work for you....
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: rzrz on May 05, 2012, 09:54:31 AM
Hi how to have a navigation arrows in the lightbox? Currently I need to click on each to show individually.
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: solwininfotech on May 16, 2012, 15:32:27 PM
i will tell you this after i check it
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: lipes on May 19, 2012, 01:30:07 AM
anyone knows how to disable the bad Facebox from (add to cart, Terms of Service, etc) and add the default modal or shadowbox or any other beautiful box in VM2 ?!

I dont like Facebox  because of the tiny "x" to close, and its hover the scroller in Shop Terms .. etc.. it's a bad layout/building...

best regards
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: rupesh on June 08, 2012, 10:46:19 AM
Quote from: aminorart on April 29, 2012, 18:08:10 PM
Hello @rupesh

How were you able to fix your issue with the images displaying in lightbox? Was the Lightbox 2 install what fixed your problem? My product images are opening in a new window when I click on them. Any help from anyone would be very appreciative!
I have implemeted prettylightbox
Title: Re: Virtuemart 2 (product page) & Lightbox
Post by: rzrz on August 08, 2012, 04:30:46 AM
Quote from: rupesh on June 08, 2012, 10:46:19 AM
Quote from: aminorart on April 29, 2012, 18:08:10 PM
Hello @rupesh

How were you able to fix your issue with the images displaying in lightbox? Was the Lightbox 2 install what fixed your problem? My product images are opening in a new window when I click on them. Any help from anyone would be very appreciative!
I have implemeted prettylightbox

Hi care to share how ? Thanks