VirtueMart Forum

VirtueMart 2 + 3 => FAQ Frequently Asked Questions => Topic started by: jenkinhill on October 17, 2013, 15:17:23 pm

Title: jQuery JavaScript conflicts and general js debugging.
Post by: jenkinhill on October 17, 2013, 15:17:23 pm
jQuery conflicts can occur when two or more versions of the jQuery library are loaded on a page. The effect of this problem is that VirtueMart, the lightbox or some other extension - even the template - may not work properly. A typical effect on VirtueMart is failure of a JavaScript driven function such as add to cart, fancybox, quantity changer, state dropdown selector etc.

Conflict issues are frequently found in commercial templates where there is a heavy reliance on scripting to provide fancy menus, slideshows, sliders and so on. It is not unkown for a template to load its own jQuery version (Artisteer templates very often do this so is a first place to check if you use that template system) and for an added slideshow module to load its own version. If you then have VirtueMart running on the page then that also will usually load its jQuery version.

Tools to detect conflicts can be Firebug's script debugger or Console error checker, or the debugger in IE9/10 developer tools.

Possible solutions could be uninstalling any module that causes conflict, a plugin such as Simple Image Gallery Pro or in some cases JoomSEF. Otherwise try using jQuery Easy or ReReplacer.

If your template uses bootstrap.js then to solve a script error with VirtueMart's jQuery (version 1.6.4) you can replace that VM version with jQuery 1.7.1 - in com_virtuemart/assets/js/ the script is named jquery.min.js   VirtueMart 2.0.x and fancybox will still work with that version.

There should be less conflict issues with VM3.x. From the VM3 release news "The new jQuery versions are now mainly the same as in Joomla 3.3 (jQuery v1.11.0,jQuery UI - v1.9.2, legacy complete). Shops using Joomla 2.5 with VirtueMart 3 also benefit from this. It prevents needless configuration problems."


jQuery Easy (rarely needed with J3.x VM3.x):


Title: Re: jQuery JavaScript conflicts
Post by: ooweboo on October 24, 2013, 14:06:07 pm
Thanks again, im trying to troubleshoot these conflicts, can i disable modules etc or do i need to uninstall them?
Title: Re: jQuery JavaScript conflicts
Post by: jenkinhill on October 24, 2013, 14:52:02 pm
Disable/unpublish them should be enough.