If you try to combine Joomla! 1.5.2 (1.5.6 works, should work for all), Virtuemart 1.1 (1.2 works, should work for all) and YooTheme template together, you will run into problems with very slow loading times and double lightboxes. Your site will try to load the same javascript over and over again. This is because both Virtuemart and YooTheme template use a javascript libary called MooTools. The problem with double lightboxes comes from having loaded two lightbox javascripts. More specifically, YooTheme template has their own lightbox called Shadowbox, while Virtuemart 1.1 utilizes a popular slimmed-down version of lightbox called Slimbox. I've figured out a workaround to these problems when using these together.

Easy one first. What happens when you try to use these together is your Joomla! site will try to load over 1000 javascripts because it's getting confused trying to load two MooTools. The fix here is simple. Disable MooTools from YooTheme template manager. All your YooTheme modules will still work because VirtueMart will load MooTools for your site.

A harder problem is with the clash between Shadowbox and Slimbox. The problem is that when you click on a product image, you end up with two different lightboxes on top of each other. The Slimbox will load first, then the Shadowbox will load on top of Slimbox. My solution is going use the Shadowbox. The reason is because Shadowbox is better. It is a bit larger in size, but it's able to display not only pictures, but any kind of videos plus external websites. Also, it takes into account how large your browser is, and it will automatically shrink down the full-size image to the maximum allowed by the browser.

So, to only use Shadowbox, we need to stop VirtueMart from loading Slimbox. Then, you'll want to change the image rel tag from "lightbox" to "shadowbox" in VirtueMart's getLightboxImageLink function.

Open htmlTool.class.php in /administrator/components/com_virtuemart/classes/

Find,

 function loadSlimBox( ) {
global $mosConfig_live_site, $vm_mainframe;
if( !defined( '_SLIMBOX_LOADED' )) {
 
vmCommonHTML::loadMooTools();
 
$vm_mainframe->addScriptDeclaration( 'var slimboxurl = \''.$mosConfig_live_site.'/components/'. VM_COMPONENT_NAME .'/js/slimbox/\';');
$vm_mainframe->addScript( $mosConfig_live_site .'/components/'. VM_COMPONENT_NAME .'/js/slimbox/js/slimbox.js' );
$vm_mainframe->addStyleSheet( $mosConfig_live_site .'/components/'. VM_COMPONENT_NAME .'/js/slimbox/css/slimbox.css' );
 
define ( '_SLIMBOX_LOADED', '1' );
} 
}

And replace it with,

 function loadSlimBox( ) {
if( !defined( '_SLIMBOX_LOADED' )) {
define ( '_SLIMBOX_LOADED', '1' );
}
}

Then, find,

 function getLightboxImageLink( $image_link, $text, $title='', $image_group='' ) {
 
vmCommonHTML::loadSlimBox(); 
 
if( $image_group ) {
$image_group = '['.$image_group.']';
}
$link = vmCommonHTML::hyperLink( $image_link, $text, '', $title, 'rel="lightbox'.$image_group.'"' );
 
return $link;
}

And replace it with,

 function getLightboxImageLink( $image_link, $text, $title='', $image_group='' ) {
 
vmCommonHTML::loadSlimBox(); 
 
if( $image_group ) {
$image_group = '['.$image_group.']';
}
$link = vmCommonHTML::hyperLink( $image_link, $text, '', $title, 'rel="shadowbox'.$image_group.'"' );
 
return $link;
}

That's it, if you have any questions, leave a comment here, and I will try to answer.

Trackback(0)
Comments (62)Add Comment
Nice Article
By Eremo della Giubiliana , February 01, 2012
Nice Article, thanks for sharing!
Quantum and Virtue
By Merle , December 05, 2011
I have a site using Yoo Quantum in Joomla. Client now wants the site to go ecommerce, but to keep the theme. Is there any way to use Virtue Mart and Keep the theme? Would greatly appreciate any help. Ta muchly
Quantum and Virtue
By Merle , December 05, 2011
I see this is an oldish discussion but only one i could find even remotely similar to my problem. I gotta site in joomla using the yoo quantum theme. The site now has to go ecommerce but client wants the theme. How can i combine virtuemart and quantum? is it possible? Would greatly appreciate any help... Ta muchly.
...
By Adam Brown , June 09, 2011
Thankyou!!
Thank You
By Paul Cotter , June 05, 2011
Worked perfectly - thanks:-)
Solution for VM and Yoocarousel issue
By Adi , June 02, 2011
IF Yoocarousel not working on the VM pagest you mus disable the call for MooTools in the file "administrator/components/com_virtuemart/classes/htmlTools.class.php"
on line 794

$vm_mainframe->addScript( $mosConfig_live_site .'/components/'.VM_COMPONENT_NAME .'/js/mootools/'.$version );

Works ok to me!
Didnt Work
By Rc , June 23, 2010
Followed instructions to the bone and double checked again and again but still had 2 images showing up , removed the slimbox file and it worked , thanks to whoever mentioned it in the comments
Thanks a million!
By mugi_san , May 09, 2010
Ok.. done it. cool info dude. But then, a bit furthermore.. is there a way we can put a watermark for our virtuemart? Any solutions or tutorial available?
great solution
By Camnio , March 24, 2010
Thanks for the solution
same issue on our website
By text messaging software , February 14, 2010
Hello, I'm having the same issue on my website between mootools and jquery with Virtuemart. Anyone else face this?
...
By nesi , January 21, 2010
Thank you!!!!!
Thanx for the easy fix
By Pictophoria , January 17, 2010
Worked brilliantly, thanx you r a star ;-)
WORKING
By Maurizio , December 28, 2009
Just a sentence:
I LOVE YOU!
SWEEEEEEEEEEEEEEEEEET !
By Carl , December 15, 2009
Hi After two days trying to correct this problem i eventualy found this page, works a treat. Can't thank you enougth.
BTW i'm not using a Yoo teamed template just a joomla 1.5 with a subblack template, VM, RSgallery and had just about the same problem and this is, from the comments above 20 months later. How can this problem still be happening 20 months later. unbelivable.
thanks
By rick , December 11, 2009
thank you man very useful!
Works for me....
By Lee , December 11, 2009
Thanks for taking the trouble to share this excellent workaround.
All the best.
Thanks God U R Back!
By Jose A Suarez , November 25, 2009
Your solution works perfectly for me, in two sites whit Yoo tamplates, and the recent down time had me worried. Thanks God U R back on line again!
slimbox VS. shadowbox vice versa
By balulilu , November 05, 2009
here this code makes makes so that shadowbox is used, enabled for some good reasons and slim box is disabled. so, my question is, if there is a way to make them both work. look, my case is next, I use virtuemart and I really like when my product enlarged images are opened with white background (as I have found out which is called to be slimbox) also I use yoogallery and images in gallery are opened with black I'd say with darker window called shadowbox.
and my problem, my only probelm is that virtue mart loads both boxes. I have no problem with YOOgallery but theres a problem with virtuemart. I want "him" to use only slimbox.

and finally the question, is it possible to do so ?
to make yoogallery use shadowbox and virtuemart to use only slimbox ?
thank you in advance anyone who will answer :)
YOOaccordion no work with virtuemart
By Francesco Caruccio , October 18, 2009
Hi! in my site www.fotoregalo.it virtuemart conflicts with YOOaccordion ( yoo tools from www.yootheme.com ).. please help me! the code you have posted not work! no difference from before
...
By Bram , October 06, 2009
awesome, 10 minutes work, great result!! :) :)Thanks a lot
Stil can t make it
By Looma , August 24, 2009
Hello,
I solved the doble lightboxes little bit different - I just turned off VM lightboxes in VM.

But I still cant get to work VM yooeffects, accordion, drawer etc... I tried to turn of mootool in yootheme settings, but still nothing :(

So has anybody some tip to get this work?

Thanks
Designer
By Mary Gabriel , August 14, 2009
Worked like a charm! You are my hero! Thank you so much.
Great
By david , July 09, 2009
Thank you for this great solution!
Thank you!
By Marcin , July 08, 2009
You are my hero! Thank you very much. It works on:
Joomla 1.5.11 and VM 1.1.3
I kinda hacked the same thing
By Leigh Barnes , June 30, 2009
randomly...

I was working on a work around to intigrate YooEffects plugin into my virtumart...

and kinda figured a much less intensive fix..( although probably not right )

I simply renamed the slimbox folder under JS in virtuemart to old_slimbox
which meant it couldnt find its precious js...

then linked the Browse_1 ( well ive got a custom one and inserted this into the image section )

>


this allowed me to have the title and use all the yootheme extensions...

simply and easily.
still not working
By andi , May 29, 2009
I don't know what I'm doing wrong, but I've tried to implement this fix on a number of sites and I just can't get it to work... do you have any ideas?
Thanks
By Murat Bilga , May 03, 2009
great solution! Thank you
Worked Perfectly!!!
By Dave , April 23, 2009
Thanks!!! this has been driving me nuts for a while now. Thanks for sharing, the VM works great now.
Yoocarousel not working with Virtuemart product description
By rubie , April 16, 2009
I'm getting this error in firebug.

Fx.Scroll is not a constructor

Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible.
------------------------

When I try to disable mootools in my template I get a new error:

Class is not defined

YOOcarousel is not a constructor
...
By kungfuMonkey , April 10, 2009
That double lightbox was driving me mad! thanx for the solution.
I have designed my own template but use Yootools all over the place.
My problem occurs when loading any VM page (eg. Show Cart) - Yootools stop working.
They are there, but they do not function apart from being able to click links.
Anyone have some advice/solution/workaround.
So annoying. would appreciate any advice.
fix not working
By andi , March 19, 2009
So do I have load mootools ON or OFF in my yoo_theme template (I have tried many different variations but none seem to make a difference).
...
By Seong Yup Yoo , March 19, 2009
Make sure you're loading yoolightbox in your template or through a separate plugin.
Fix not walking
By andi , March 19, 2009
Hi, I tried this fix in Joomla 1.5.9, VM 1.1.3, using yoo_loom 1.5.5. My virtuemart images open in a new window, no lightbox, and my banner scroller no longer works. Any ideas?

I get an error when I first load the website. (Which I can send if you need it)... something to do with yoo carousel...

but the fact that the lightbox doesn't work at all is frustrating... Is it not loading mootools now?

Thanks for any help.
andi.

THANKS!
By Matt , March 05, 2009
Dont you love it when you have a specific problem and someone has nailed it perfectly! That was this solution. Thank you.
Perfect
By Maurice , February 07, 2009
Thank you for the solution. The lightbox of VM was in combination with my template not working. Now I have a perfect working webshop.

Greetz,

Maurice
This solution still helpful Joomla 1.5.8 and Virtuemart 1.1.2
By Jason Carnley , December 21, 2008
I love the Yootheme lightbox effect it is superior to the virtuemart effect. I also like how you can scroll through all the images on a browse page as if it were a photogallery. I think that will save our shoppers time. Great job! I will look at your optimization stuff to. I'm using Yootheme shuffle and it was big and slow. I compressed all the PNG's using Gimp. There is no difference in the look except that it save at least 50K on the initial browser visit! I recommend this for everyone its the least you can do and it isn't hard, just a little busy work.
new Version Joomla and Virtuemart
By Hans Brix , November 14, 2008
Hi

I think its not working in the new versions of Joomla and Virtuemart...
Any solution?
Same problems in 1.5.7
By Sean , November 05, 2008
I have the same problems, but they are in all the newest versions. 1.5.7 Joomla and 1.1.2 virtuemart and the above fix doesn't work.
Link
By Arrawnt , October 18, 2008
Could you please give me a link to that article? I tried to use the search function but didnt find anything. Thanks!
...
By Seong Yup Yoo , October 18, 2008
There is an article that I wrote on this that fixes that problem. It's a conflict between mootools and jquery. It's an easy fix. Go read the article.

Well I'm having a differente problem. The matter is that I can not get YooAccordion, YooToppanel or YooCarousel to work when you are looking a product details. Please take a look at www.informatica-connect.com/shop and see it yourself by clicking on a product. YooAccordion shows opened and it does not work at all. Sames goes to Carousel and Toppanel. What should I do?

Thanks in advance!
YooTools problem
By Arrawnt , October 18, 2008
Well I'm having a differente problem. The matter is that I can not get YooAccordion, YooToppanel or YooCarousel to work when you are looking a product details. Please take a look at www.informatica-connect.com/shop and see it yourself by clicking on a product. YooAccordion shows opened and it does not work at all. Sames goes to Carousel and Toppanel. What should I do?

Thanks in advance!
Ignore me!!!
By Pinc , October 17, 2008
Never mind, it did work, I copied the code wrong! LOL!! :D
...
By Pinc , October 17, 2008
This didn't work for me on 1.5.7 version of Joomla?? :o
Thanks!
By Dude , October 11, 2008
Your tipped worked great. Thanks!
thank you
By caroline , August 25, 2008
this was so easy to fix with your help. It's what makes open source and forums so great ;D
thank you for the effort and sharing!
...
By Seong Yup Yoo , August 16, 2008
Thanks, no I do not know why the product display page is not showing properly on IE7 and working perfectly on Firefox, but I am aware of this issue, I've just lived with it as it wasn't a huge problem, but I will try to look into it soon.

Your "Add-to-cart" button might be cut off because the whole box is taking too much space, and get hidden under something else. Try widening your template. All product descriptions really narrow is probably something associated with your virtuemart product descriptions template.


This is great!
By hiten , August 14, 2008
Thanks for this excellent tweak, was frustrated for a long time over it. Do you also know why the product display page is not showing properly on IE7 and working perfectly with firefox? In IE7, the "Add-to-cart" button is cut off, and all product descriptions are really narrow.

Thanks.
This is great!
By hiten , August 14, 2008
Thanks for this excellent tweak, was frustrated for a long time over it. Do you also know why the product display page is not showing properly on IE7 and working perfectly with firefox? In IE7, the "Add-to-cart" button is cut off, and all product descriptions are really narrow.

Thanks.
Thank you!!!
By Caldia Support , August 10, 2008
Was driving us crazy.....Many Thanks!!!!!!!!
Thnx!
By Maarten , August 01, 2008
Glad I found this ! Thnx for your work !
RE:Are these original
By Seong Yup Yoo , July 22, 2008
I came up with this hack to fix this problem. All mine, but feel free to spread this information and remix it. Just let me know you reference it with trackback and give me credit on your article.
...
By localhost , July 22, 2008
Hi

Are these original solutions ? I have seen the same on a few forums, eg YOOtheme, BOJ etc, that are dated before yours, either way someones fooling someone. You however claim to have discovered the solutions.

Anyways thanks for making the webspace available for sharing this with the community.
Thanks!
By Miguel , June 17, 2008
You are the man! Thanks - I was going crazy trying to figure out a fix. Knowledge is power! Kudos to you man!
Great!
By admin , May 29, 2008
Ok, problem solved in Joomla 1.0.15 and Virtuemart 1.1.0.

I have changed the code in yt_sunblogger/index.php

I use the same mootools file in the yt_sunblogger and virtuemart. No conflits!!!

Best Regards, André.

That would fix it. I know exactly what was the problem and why that fixed it. You were loading two different versions of mootools. There is already code in virtuemart htmlTools that checks if mootools has already been loaded, but it checks it by checking its version number. However, YooTheme, and VirtueMart load different versions of mootools, so the code that checks this didn't get triggered. However, after you changed the your index to include the same version of mootools, that code started to trigger, and so things are working again. Don't forget to gzip your mootools to get performance increase. Also, why did you decide to go with J!1.0? instead of 1.5?
...
By lopes80andre , May 29, 2008
Ok, problem solved in Joomla 1.0.15 and Virtuemart 1.1.0.

I have changed the code in yt_sunblogger/index.php

I use the same mootools file in the yt_sunblogger and virtuemart. No conflits!!!

Best Regards, André.
Video that describes the problem
By lopes80andre , May 29, 2008
Hi Seong,

I have made a video that describes the problem, you can see here: http://www.youtube.com/watch?v=Znhcg7dBwoE

My question is: How to add few lines of php code to load mootools only if mootools is not currently loaded? I'am not a programmer. If you can help me on this I appreciate.

Thanks.

Paul, Martino87r, Troels
By Seong Yup Yoo , May 28, 2008
I thought this fix would be helpful to many. If you're using YooTheme templates, and/or Virtuemart, and Joomla, you should bookmark my site. I have some more fixes plus pretty big performance tweaks for YooTheme. Their templates are big and slow, and I figured out pretty much everything you can do to optimize and speed up YooTheme sites on while I was trying to reduce loading times of my sites that are on shared-hosting, which I think many people would find useful.

Hmm... I need to figure out a way to quote comments inside comments.
André
By Seong Yup Yoo , May 28, 2008
André,

First, I've never used Joomla 1.0, but I've used both Virtuemart 1.1 and YooTheme Sunblogger. I am assuming that Virtuemart 1.1 for J!1.5 is mostly same as the one for J!1.0 which is important to verify yourself at expense of own your time because Virtuemart 1.1 for J!1.5 uses AJAX.

Your question is "Is there a way to make this line work only when I'm out of virtuemart component?" The answer is yes, but it means that you can't use anything that depends on mootools when you're using any virtuemart component. This means that you lose functionality if you fix it this way. You should try to find exactly what is breaking your cart, and and fix the issue there. Two ways I can think of that may be the cause of your problem are: (1), Mootools has already been loaded, and it's having problems when virtuemart tries to load it again. (2), Mootools is crashing with another Javascript framework that virtuemart is using.

Try to figure out which of the two situations you're in, and if you're in (1), then add few lines of php code to load mootools only if mootools is not currently loaded. Ask me again if don't know how to do this, it should be pretty easy. If you're in (2), then check this article I wrote which has a fix for this situation.

http://www.seongyupyoo.com/index.php?option=com_content&view=article&id=10:how-to-use-fireboard-jquery-and-yootheme-or-rockettheme-mootools-together-with-noconflict&catid=13:joomla&Itemid=29

Let me know if you find that you're not in either of these situation.
Thank You
By Paul , May 28, 2008
Hi,

I just about removed all the hair from my head, trying to resolved this issue!

Your guide, to the point, and clear, was a great find and fixed the issue instantly!

Thank you, o lord, o might one! :P
...
By Andre , May 28, 2008
The quoted text that does not show up correctly:


/lib/js/mootools/mootools.js" type="text/javascript">
...
By Andre , May 28, 2008
Hi,

I'am using Joomla 1.0.15, VirtueMart 1.1.0 and Yootheme Sunblogger.

My Problem is the Cart that don't add products because the MooTools.

The only way to make the cart work is when I disable "loadJavascript" in the template parameters on "templates/yt_sunblogger/index.php" or delete this line bellow in the same file


/lib/js/mootools/mootools.js" type="text/javascript">

There is a way to make this line work only when I'am out of virtuemart component?

Best Regards, André.
Great!!!
By Martino87r , May 23, 2008
Wow thanks for this great solution! I've asked for help on the **** support for the component (it's commercial) and received none >:( >:(
Im not a guru of PHP, and they asked me to do the same thing that you have perfectly illustrated here, you're the best!! thank you
Perfect solution!
By Troels , May 02, 2008
That was an easy solution to a annoying problem.
Thanks for sharing this great workaround

Write comment
smaller | bigger

security code
Write the displayed characters


busy