WooCommerce jQuery Cookie JS Error

If you have a variable product that doesn’t work such as adding to the cart or simply can’t even see the add to cart button, it may be due to an indirect cause of not being able to read in the jQuery Cookie js script. This happens because your host is using an out dated mod_security ruleset.

So you have two choices. Either you contact them to have this fixed. Or you can use a simple plugin I created here WooCommerce jQuery Cookie Fix

This entry was posted in Splashing Blog, WooCommerce and tagged , by Matt. Bookmark the permalink.

About Matt

Matt Hall is a web developer, marketer, and WordPress enthusiast. When he isn't organizing new WP projects, he can be found enjoying the sun, exotic coffees, and craft beers with friends.

28 thoughts on this article

  1. Bowing down to you right now Roy! Have been struggling with trying to find out why the add to cart button wasn’t showing. And given all the noise in the past week with the Woocommerce update, made it even harder to get a response from… well anyone!

    Your plugin worked perfectly.

    Before coming across your post, I did submit a ticket to my hosting provider asking whether there might be issues with Suhosin, max_input_vars or the mod security settings as per what I had read here:


    Given that your solution is working as a plugin, what might I be able to relay to my host as far as a server side fix?

    Again, thanks!

  2. I had issue with a variable product not adding to cart. The button was there but it just wasn’t adding to the shopping cart.
    I found the excerpt below mentioned on the Woocommerce site and I simply changed the name of the file to /variable1.php and that seemed to fix it. Your professional opinion, should I undo my change and try to fix it with your above mentioned solution or is this a separate issue?

    Variable products won’t add to cart –
    Because some themes still bundle old files for the add to cart template being used for variable products, adding a variable product to cart fails. This should be solved by the theme developers by updating the template file.

    A quick solution is to delete this file from your theme directory:

    This will make WooCommerce use the new bundled template file and your variable products will add to cart again. Once your theme developer updates your theme, please check if it actually works as that will overwrite this change again.

    • This plugin is only if you have specific issues with jQuery Cookie not found which causes variable add to cart problems. Other than that, you should not use it. Gathering from your information, it seems your theme is using dated templates that is the cause so you need to ask your theme developer to update the theme to be WC 2.1+ compatible.

      • I’m using mio, and I have the same problem. I click add to cart, and nothing adds to cart, on a variable product. How do I go about fixing this? “Your theme has bundled outdated copies of WooCommerce template files”

  3. I fixed it myself, but not sure how: i renamed these files:

    to have the _ instead of the . and it’s now working again. Please advise as to how I can get this working permanently and not be scared to update Woocommerce.

  4. Hi Roy, this plugin is not working. Using Avada theme and WC 2.0.20. I’ve tried renaming the files in

    still nothing. Help? 🙂

  5. I wish I one of the lucky ones who got the fix with this plug in as it did not work for me.

    It’s so frustrating 🙁

    one day variable add to cart was there and everything was perfect the next day it was gone, just vanished out of the blues.

Splash your Comments

Your email address will not be published. Required fields are marked *