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 Roy Ho. Bookmark the permalink.

About Roy Ho

Roy Ho is a web site design and developer. He loves creating websites from the inception mockup sketch work to the backend coding. You can find him in front of the computer almost always -- like right now. Yeah basically he has no life but a WordPress life! Oh, did I mention he LOVES WordPress?

20 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:

    http://docs.woothemes.com/document/problems-with-large-amounts-of-data-not-saving-variations-rates-etc/

    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!
    Gary

  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:

    /woocommerce/single-product/add-to-cart/variable.php
    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:
    /public_html/wp-content/plugins/woocommerce/assets/js/jquery-cookie

    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
    wp-content/plugins/woocommerce/assets/js/jquery-cookie

    still nothing. Help? :)

Splash your Comments

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

*

*