Author Topic: pop up for add to cart not working, possible jquery conflict  (Read 337 times)

StompJames

  • Beginner
  • *
  • Posts: 25
  • A beginner
  • Skype Name: James Pett (james@ridestomp.com)
pop up for add to cart not working, possible jquery conflict
« on: March 02, 2018, 18:16:23 pm »
Hello,

I have an issue with fancybox being initialised more than once,  I believe this is a jquery conflict? I have tried to remove any other scripts but have had no luck.

When I look in Firefox developer I can see a script called:

https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.js:11:450

I went to Cloudflare some time ago due to DDoS attack but it did not really help. I have deleted my website from the account and checked my DNS to ensure it no longer points to them. It does not. I still get this error though:

Error: fancyBox already initialized
jquery.min.js:2:1814
error
https://staging.mafiabike.com/media/jui/js/jquery.min.js:2:1814
<anonymous>
https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.js:11:450
<anonymous>
https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.js:11:2


How can I resolve this, it is stopping my add to cart pop up and I wan to use it. If I disable the pop up add to cart works. I have tried a plugin to block the script called jquery easy but that did not work.

My test site is:
staging.mafiabike.com

Excuse the certificate, I have not enabled it for this subdomain. I run SSL on mafiabike.com and this is a copy.

Joomla! 3.6.5   
VirtueMart 3.0.18

I really need to sort this and will gladly pay for support if needed and fast.


Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3039
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: pop up for add to cart not working, possible jquery conflict
« Reply #1 on: March 04, 2018, 16:09:23 pm »
You have other javascripts error :
Quote
Uncaught ReferenceError: LoadParams is not defined
You have a javascript line
Code: [Select]
window.onload = LoadParams;But LoadParams is not declared

Quote
ReferenceError: priceStart is not defined
because this code
Code: [Select]
function start() {
        priceStart();
        SortPriceDisplay();
                      }
                     
window.onload = start;



</script>
This is certainly a template addon, so you should check with your template provider.
Note that i dont have any problem about fancybox on your stagin site.

StompJames

  • Beginner
  • *
  • Posts: 25
  • A beginner
  • Skype Name: James Pett (james@ridestomp.com)
Re: pop up for add to cart not working, possible jquery conflict
« Reply #2 on: March 04, 2018, 17:37:09 pm »
Hi,

Thanks for the response, I can fix those errors you mention- it’s some old code that needs to be removed/corrected I think. Do you think they would cause my pop up issue?

So you don’t see the cloudflare error that I do? I have removed the site from cloudflare so perhaps it’s resolved itself. I will check. Also, do you not see the fancybox error?

Thanks,

James

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3039
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: pop up for add to cart not working, possible jquery conflict
« Reply #3 on: March 04, 2018, 20:12:49 pm »
when you go to us website, you dont have any fancybox error
In stagin site
Code: [Select]
function prepareImageLightbox () {
jQuery("a[rel^='catproduct_images']").each(function() { jQuery(this).fancybox({
"titlePosition" : "inside",
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});});
}


Should be
Code: [Select]
function prepareImageLightbox () {
jQuery("a[rel^='catproduct_images']").fancybox({
"titlePosition" : "inside",
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});});
}

And after
      
jQuery(document).ready(function() {
         jQuery("a[rel=catproduct_images_0]").fancybox({
         "titlePosition"    : "inside",
         "transitionIn"   :   "elastic",
         "transitionOut"   :   "elastic"
         });});jQuery(document).ready(function() {
         jQuery("a[rel=catproduct_images_1]").fancybox({
         "titlePosition"    : "inside",
         "transitionIn"   :   "elastic",
         "transitionOut"   :   "elastic"
         });});jQuery(document).ready(function() {
         jQuery("a[rel=catproduct_images_2]").fancybox({
         "titlePosition"    : "inside",
         "transitionIn"   :   "elastic",
         "transitionOut"   :   "elastic"
         })
And each time script is added again and again 43 times !
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.js"></script>
I have send you a PM, if you need a developer. It's no t cloudflare problem, but bad plugin or template.