Sunday, 13 April 2008 23:30 Last Updated on Friday, 24 December 2010 08:29
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.

By Merle , December 05, 2011
By Merle , December 05, 2011
By Adi , June 02, 2011
on line 794
$vm_mainframe->addScript( $mosConfig_live_site .'/components/'.VM_COMPONENT_NAME .'/js/mootools/'.$version );
Works ok to me!
By Rc , June 23, 2010
By mugi_san , May 09, 2010
By text messaging software , February 14, 2010
By Carl , December 15, 2009
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.
By Lee , December 11, 2009
All the best.
By Jose A Suarez , November 25, 2009
By balulilu , November 05, 2009
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 :)
By Francesco Caruccio , October 18, 2009
By Looma , August 24, 2009
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
By Marcin , July 08, 2009
Joomla 1.5.11 and VM 1.1.3
By Leigh Barnes , June 30, 2009
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.
By andi , May 29, 2009
By Dave , April 23, 2009
By rubie , April 16, 2009
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
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.
By andi , March 19, 2009
By andi , March 19, 2009
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.
By Matt , March 05, 2009
By Maurice , February 07, 2009
Greetz,
Maurice
By Jason Carnley , December 21, 2008
By Hans Brix , November 14, 2008
I think its not working in the new versions of Joomla and Virtuemart...
Any solution?
By Sean , November 05, 2008
By Arrawnt , October 18, 2008
By Arrawnt , October 18, 2008
Thanks in advance!
By caroline , August 25, 2008
thank you for the effort and sharing!
By hiten , August 14, 2008
Thanks.
By localhost , July 22, 2008
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.
By Miguel , June 17, 2008
By lopes80andre , May 29, 2008
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é.
By lopes80andre , May 29, 2008
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.
By Paul , May 28, 2008
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
/lib/js/mootools/mootools.js" type="text/javascript">
By Andre , May 28, 2008
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é.
By Martino87r , May 23, 2008
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
By Troels , May 02, 2008
Thanks for sharing this great workaround
