Fancybox not compatible with Joomla! jQuery v.1.12.4 (actually is)

Started by man.of.earth, August 29, 2019, 22:52:54 PM

Previous topic - Next topic

man.of.earth

Hello,

I saw that fancybox does not work only with joomla 3.9.11 native jQuery version (1.12.4), but only with version 1.9.2 (this was tested on VM v3.6 and 3.5, vmbeez template).
So, in order to make it work, the VM jQuery must be loaded too, which makes jQuery to be loaded twice (different versions).
Is there a replacement for fancybox that works with jQuery v1.12.4?

Jörgen

Yes but not free for commercial use.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

man.of.earth

#2
Ah...

Actually, on the cart page, if "Load the VM jQuery framework" wasn't ticked in VM configuration, fancybox did not load at all. Fancybox actually works with the v1.12.4 of jQuery.

I found a workaround to this:

I modified the file /templates/<TEMPLATE_NAME>/html/com_virtuemart/cart/default.php
by adding
if(VmConfig::get('usefancy',1)){
vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack',false, false);
vmJsApi::css('jquery.fancybox-1.3.4');
}


right after
vmJsApi::vmValidator();
(about line 25)

In this case, fancybox works without selecting loading any of the jQuery frameworks in the VM configuration (only with the one of the Joomla! template, if it loads jQuery independently of VM).

man.of.earth

Actually, if I deactivate load "VM jQuery framework" in VM configuration, the add to cart in a popup functionality does not work any longer.

Milbo

the function loadPopUpLib in vmjsapi.php has in line 484


if(!VmConfig::get ('jquery', true)) {
return true;
}


I think this is old and should be removed.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/