VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: man.of.earth on August 29, 2019, 22:52:54 PM

Title: Fancybox not compatible with Joomla! jQuery v.1.12.4 (actually is)
Post by: man.of.earth on August 29, 2019, 22:52:54 PM
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?
Title: Re: Fancybox not compatible with Joomla! jQuery v.1.12.4
Post by: Jörgen on August 29, 2019, 23:36:17 PM
Yes but not free for commercial use.

Jörgen @ Kreativ Fotografi
Title: Re: Fancybox not compatible with Joomla! jQuery v1.12.4
Post by: man.of.earth on August 30, 2019, 01:12:58 AM
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).
Title: Re: Fancybox not compatible with Joomla! jQuery v.1.12.4
Post by: man.of.earth on August 30, 2019, 01:29:36 AM
Actually, if I deactivate load "VM jQuery framework" in VM configuration, the add to cart in a popup functionality does not work any longer.
Title: Re: Fancybox not compatible with Joomla! jQuery v.1.12.4 (actually is)
Post by: Milbo on September 07, 2019, 09:10:28 AM
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.