Add To Cart not working
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I have submitted this to Wordpress and to the Template developer but with some recent updates, I can not determine what is going on with my site.

The site in question is www.graciesgearandtraining.com. Visit any product page, specifically, let's say this one ; https://www.graciesgearandtraining.com/store/gracies-gear-long-tank/
I've tried on a Mac (Safari and Chrome) and on a PC (Chrome and Explorer) but I see the same errors. They are;

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.cookie.min.js, line 0)

[Error] TypeError: 'undefined' is not a function (evaluating 'e.cookie("woocommerce_items_in_cart")')
(anonymous function) (cart-fragments.min.js, line 1)
c (jquery.js, line 3)
fireWith (jquery.js, line 3)
ready (jquery.js, line 3)
q (jquery.js, line 3)

Here's what I've read about and tried to do to fix the issue.
1) I've pointed out the issue to the hosting company. They do not see anything conflicting on their end with this, they think it's a plugin issue.
2) I've disabled all the major plugin's that I felt in some way could effect this and nothing has worked.
3) I've repaired and checked the database
4) I've read that it 'could' be that there's a line of code referencing the wrong version of jquery. If that's so, I don't know how to determine where that is.
5) I've refreshed the woo commerce product itself, no effect.
6) I've checked the 'system status' in woo commerce. No issues.
7) I've checked for updates on woo commerce, mayashop, and other various plug-in's. No luck.

This cropped up randomly but it's preventing ALL sales so I'm hoping to quickly find a fix!

The similar bountify thread that had a resolution is https://bountify.co/wp-theme-woocommerce-js-issue-cannot-read-property-of-undefined-2
I could not figure out how or if I should take that resolution and apply it to this situation. I have VERY limited jQuery experience.

Wow that first response was fast. Also, right after I posted this i picked up a new error cropping up on the page today. haven't seen it before, and no idea if it's related at all. [Error] QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota. success (cart-fragments.min.js, line 1) c (jquery.js, line 3) fireWith (jquery.js, line 3) k (jquery.js, line 5) r (jquery.js, line 5)
drbotts 5 years ago
Ok, so here's the solution. But because this is my first time with Bountify, I don't know how to mark this Bounty as solved and remove it. So I'm going to just award the bounty to the first person who gave me their best effort with a suggestion. Thank you all so much! I'll be back, you guys rock.
drbotts 5 years ago
Ok, found a solution. Totally different from this but I want to make sure this is out there. Hosting provider came back with a fix. "fixed by disabling mod_security filter for your account" No idea what caused it.
drbotts 5 years ago
@drbotts: lol, that explains it!
alixaxel 5 years ago
awarded to skram

Crowdsource coding tasks.

2 Solutions

Winning solution

I think the first issue you need to tackle is that "https://www.graciesgearandtraining.com/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=1.3.1" is trying to be loaded but it is not there. You can try and include a version from https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.3.1/jquery.cookie.min.js and see if they fixes your issues which I think it might.

Ok, found the directory. Downloaded that file, and navigated there to find that the file exists there now. I replaced it, just in case but no change. Thanks for your quick reply though!
drbotts 5 years ago
ALSO.. just in case it matters, permissions on that file are 644
drbotts 5 years ago
I'm still seeing GET https://www.graciesgearandtraining.com/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=1.3.1 404 (Not Found) so I cant debug further, sorry.
skram 5 years ago
Does the file need to end with the ver= info? The path and name now are... /public_html/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js
drbotts 5 years ago
See top section for solution.
drbotts 5 years ago

This is very weird, as the file is there:

https://www.graciesgearandtraining.com/wp-content/plugins/woocommerce/assets/js/jquery-cookie/

But if you try to access it directly by clicking it (the ?ver=1.3.1 is optional), you get the 404 error.

As far as the permissions go, even 0444 would be enough to serve the file, so that can't be it.

I suspect the problem might lie in a mod_rewrite rule. Would you mind sharing your .htaccess with us?

Alternatively, just use jsCDN as @skram mentioned. It's a fast CDN with very reliable uptimes:

//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.3.1/jquery.cookie.min.js
Thanks for joining in! So, I have never used jsCDN before. It looks wildly interesting but I'm going to just post the contents of my .htaccess file here in lieu of learning all that right now. Something else just to clarify. I can access the file in cpanel and view the file fine. But yes, front end access.. 404 BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUESTFILENAME} !-f RewriteCond %{REQUESTFILENAME} !-d RewriteRule . /index.php [L] END WordPress RewriteCond %{HTTPHOST} ^graciesgearandtraining.com$ [OR] RewriteCond %{HTTPHOST} ^www.graciesgearandtraining.com$ RewriteRule ^webmail$ "https:\/\/fekete.tchmachines.com:2096\/logout\/\?locale=en" [R=301,L]
drbotts 5 years ago
View Timeline