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

Virtuemart 2 (product page) & Lightbox

Started by scotous, December 31, 2011, 13:56:39 PM

Previous topic - Next topic

scotous

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?

Ducksoul

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

scotous

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.

scotous

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!

charles99

Scotous fixed really do work! I was just getting ready to dive into the lightbox issue...

good job!

idemsisvoje

#5
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?

scotous

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.

idemsisvoje

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/

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

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

scotous

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)

idemsisvoje

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

kaleske

Hello fancybox plugin didn`t work for me. Can anybody help me?

Rinie Engelen

#11
Hello to all,

I've done as follow:
Installed and activated the plugin 'shadowbox' (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

rupesh

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/

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?

aminorart

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!

solwininfotech

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....