Author Topic: How to update Fancybox?  (Read 402 times)

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
How to update Fancybox?
« on: November 06, 2018, 10:44:07 am »
JUI Jquery 3.1 override works well by template overriding
Code: [Select]
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

  • Jr. Member
  • **
  • Posts: 416
Re: How to update Fancybox?
« Reply #1 on: November 06, 2018, 10:51:58 am »
Fancybox can be overriden too. Place overrides in:

Code: [Select]
templates/your_template/js/fancybox/jquery.fancybox-1.3.4.pack.js
and

Code: [Select]
templates/your_template/css/jquery.fancybox-1.3.4.css
Just be aware that new versions may not work properly with VM.

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #2 on: November 06, 2018, 11:01:39 am »
i did.
will be overwritten on update
this add costs to supporting it

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1757
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: How to update Fancybox?
« Reply #3 on: November 06, 2018, 11:09:00 am »
Did You try Ghost suggestion ? Should not be overwritten IMHO.

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How to update Fancybox?
« Reply #4 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?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #5 on: November 06, 2018, 12:24:31 pm »
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:
Code: [Select]
/*
    if (usefancy) {
        jQuery.fancybox.showActivity(); // it is deprecated and not used in v.3
    }
*/
and change this
Code: [Select]
if (usefancy) {
                jQuery.fancybox({
                        "titlePosition": "inside",
                        "transitionIn": "fade",
                        "transitionOut": "fade",
                        "changeFade": "fast",
                        "type": "html",
                        "autoCenter": true,
                        "closeBtn": false,
                        "closeClick": false,
                        "content": txt
                    }
                );
            }
to this
Code: [Select]
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How to update Fancybox?
« Reply #6 on: November 06, 2018, 12:26:17 pm »
Thanks for the feedback
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #7 on: November 06, 2018, 12:27:12 pm »
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1757
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: How to update Fancybox?
« Reply #8 on: November 06, 2018, 12:47:07 pm »
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.

Quote
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 @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #9 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:
Code: [Select]
\components\com_virtuemart\assets\js\fancybox\jquery.fancybox-1.3.4.pack.js and
Code: [Select]
\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

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #10 on: November 06, 2018, 12:58:28 pm »
also, you need some changes in default_images.php for images gallery in fancybox v3:
add 
Code: [Select]
data-fancybox="gallery" data-type="image" to all images in this file
Code: [Select]
echo $this->product->images[0]->displayMediaThumb("", true, ' rel="vm-additional-images" data-fancybox="gallery" data-type="image" ', true, true, false, $width, $height);

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #11 on: November 06, 2018, 14:28:46 pm »
Found only one problem with rupostel OPC, cannot resolve this:

d0ublezer0

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #12 on: November 06, 2018, 14:33:47 pm »
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

  • Jr. Member
  • **
  • Posts: 416
Re: How to update Fancybox?
« Reply #13 on: November 07, 2018, 10:53:13 am »
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:
Code: [Select]
\components\com_virtuemart\assets\js\fancybox\jquery.fancybox-1.3.4.pack.js and
Code: [Select]
\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

  • Jr. Member
  • **
  • Posts: 169
Re: How to update Fancybox?
« Reply #14 on: November 07, 2018, 11:27:59 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?
Code: [Select]
\templates\your_template\com_virtuemart\assets\js\fancybox\jquery.fancybox-1.3.4.pack.js
not overriden