VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: H13 on January 31, 2013, 00:10:58 AM

Title: TypeError: jQuery(...).fancybox is not a function
Post by: H13 on January 31, 2013, 00:10:58 AM
Hi, in VM 2.0.18a (Joomla! 2.5.8) I get this problem while loading product page

TypeError: jQuery(...).fancybox is not a function
"transitionOut"   :   "elastic"

- it depends on used template, mostly when the template loads jquery, there is such problem (I have tried to disable the loading/not loading jquery etc. in VM settings, but does not help)

Is there any way e.g. how to change the fancybox to standard popup window or other popup?

Thank you.

Jan

Title: Re: TypeError: jQuery(...).fancybox is not a function
Post by: jenkinhill on January 31, 2013, 10:12:20 AM
You have a jQuery issue, sounds like you are not loading the js files in the correct order. This is something that I have seen in some commercial templates, and can often be "fixed" by using jQuery Easy (http://extensions.joomla.org/extensions/core-enhancements/performance/jquery-scripts/18327)

To remove the FB function you can edit the image display code in the  product details display template(s) and set the edited files as template overrides.
Title: Re: TypeError: jQuery(...).fancybox is not a function
Post by: ichepurnoy on April 22, 2014, 16:25:07 PM
Quote from: jenkinhill on January 31, 2013, 10:12:20 AM
You have a jQuery issue, sounds like you are not loading the js files in the correct order. This is something that I have seen in some commercial templates, and can often be "fixed" by using jQuery Easy (http://extensions.joomla.org/extensions/core-enhancements/performance/jquery-scripts/18327)

To remove the FB function you can edit the image display code in the  product details display template(s) and set the edited files as template overrides.
Dear Jenkinhill!

Thanks for pointing at jQuery Easy, it really helps with JS conflicts.
Though I found a bug in latest Virtuemart 2.6.0, which was also present in versions 2.0.24 - 2.0.26. The Bug is in the setting "Use fancybox" in Configuration \ Templates.  If you select YES, the site loads Fancybox. If "NO",  then site still loads fancybox, and adds facebox. This way , when "Use fancybox = NO", we have:

I've made a solution, it fixes all 3 points. It's not a hack! Just a small fix (the IF condition checking for Fancybox state was missing  ;)) . I fixed it using your own pieces of code.
3 edited Files are:
\components\com_virtuemart\assets\js\facebox.js
\components\com_virtuemart\views\productdetails\tmpl\default_images.php
\components\com_virtuemart\assets\css\facebox.css
You can compare them with originals to see the diference.


[attachment cleanup by admin]
Title: Re: TypeError: jQuery(...).fancybox is not a function
Post by: Milbo on April 24, 2014, 10:07:27 AM
hahaha

"// WTF is all this?????  Do we really need it?"

It makes the gallery effect on fancybox. That you get arrows to click to the next image. Imho not needed for facebox, yes.

For what you added this?
<span></span>\

in facebox.js? opacity 0.6? I wonder if there should be any opacity. why not 0.0?

Anyway your changes looks good. They are added for vm2.6