News:

Looking for documentation? Take a look on our wiki

Main Menu

How to update Fancybox?

Started by d0ublezer0, November 06, 2018, 10:44:07 AM

Previous topic - Next topic

d0ublezer0

JUI Jquery 3.1 override works well by template overriding
templates\my-template\js\jui\jquery.min.js
But VM fancybox is too old for new version of Jquery
how to update jquery.fancybox-1.3.4.pack.js ?
version 3 is already out: https://fancyapps.com/fancybox/3/
if i overwrite them with new version - it will be overwritten on next update

Ghost

Fancybox can be overriden too. Place overrides in:

templates/your_template/js/fancybox/jquery.fancybox-1.3.4.pack.js

and

templates/your_template/css/jquery.fancybox-1.3.4.css

Just be aware that new versions may not work properly with VM.

d0ublezer0

i did.
will be overwritten on update
this add costs to supporting it

Jörgen

Did You try Ghost suggestion ? Should not be overwritten IMHO.

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

GJC Web Design

if its in your template and u don't update your template then no..

Can u report back if the v3 works with VM?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

d0ublezer0

Quote from: GJC Web Design on November 06, 2018, 11:10:08 AM
if its in your template and u don't update your template then no..

Can u report back if the v3 works with VM?
i cannot move scripts to my template because VM have older version built-in. only replacing will help me.

and, yes it works with minimal ajustments:
vmprices.js
comment this:
/*
    if (usefancy) {
        jQuery.fancybox.showActivity(); // it is deprecated and not used in v.3
    }
*/

and change this
if (usefancy) {
                jQuery.fancybox({
                        "titlePosition": "inside",
                        "transitionIn": "fade",
                        "transitionOut": "fade",
                        "changeFade": "fast",
                        "type": "html",
                        "autoCenter": true,
                        "closeBtn": false,
                        "closeClick": false,
                        "content": txt
                    }
                );
            }

to this
if (usefancy) {
                jQuery.fancybox.open(txt);
            }


Also fancybox v 3 supports ajax requests and data filtering: https://fancyapps.com/fancybox/3/docs/#ajax

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

d0ublezer0

#7
Quote from: Jörgen on November 06, 2018, 11:09:00 AM
Should not be overwritten IMHO.
Why do you think so? Obsolete files will come along with the installation kit and then they will be written over the modified ones.

Jörgen

You got to be kidding. Why would VM overrite them? The whole idea of overrides is that a normal installation uses the override files instead of the default ones, not trying to override the overrides.

QuoteWhy do you think so? Obsolete files will come along with the installation kit and then they will be written over the modified ones.

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

d0ublezer0

Jörgen, you probably did not understand me.
Of course, the VM will not change the overrided files.
It will replace files in its component folder:
\components\com_virtuemart\assets\js\fancybox\jquery.fancybox-1.3.4.pack.js
and
\components\com_virtuemart\assets\css\jquery.fancybox-1.3.4.css
It can not be moved to the template overrides - inclusion of this file has built into the VM core.
so the only working solution is to replace its contents with a new version.

d0ublezer0

also, you need some changes in default_images.php for images gallery in fancybox v3:
add 
data-fancybox="gallery" data-type="image"
to all images in this file
echo $this->product->images[0]->displayMediaThumb("", true, ' rel="vm-additional-images" data-fancybox="gallery" data-type="image" ', true, true, false, $width, $height);

d0ublezer0

Found only one problem with rupostel OPC, cannot resolve this:

d0ublezer0

The main reason why you need to update this outdated plugin: it does not work with the new version of jquery 3.1
to ensure compatibility of new and old scripts is very expensive. eg owl carousel

Ghost

Quote from: d0ublezer0 on November 06, 2018, 12:54:52 PM
Jörgen, you probably did not understand me.
Of course, the VM will not change the overrided files.
It will replace files in its component folder:
\components\com_virtuemart\assets\js\fancybox\jquery.fancybox-1.3.4.pack.js
and
\components\com_virtuemart\assets\css\jquery.fancybox-1.3.4.css
It can not be moved to the template overrides - inclusion of this file has built into the VM core.
so the only working solution is to replace its contents with a new version.
You make no sense. If you place new files in locations shown in first post, these files will override VM core files.

d0ublezer0

Quote from: Ghost on November 07, 2018, 10:53:13 AM
You make no sense. If you place new files in locations shown in first post, these files will override VM core files.
oh, really?
override for any file, not only "views" templates?
so, can you try it by yourself?
\templates\your_template\com_virtuemart\assets\js\fancybox\jquery.fancybox-1.3.4.pack.js
not overriden