Support » Plugin: WooCommerce » Variable Product (no add to cart button) js error thrown

Viewing 7 replies - 1 through 7 (of 7 total)
  • this seems to be a common issue with several themes.
    the solution has been to tell the add-to-cart.js to be enqueued in the footer like so:

    wp_dequeue_script('wc-add-to-cart-variation');
    function fix_woo_var_cart()
    {
    	wp_enqueue_script('add-to-cart-variation', '/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.js',array('jquery'),'1.0',true);
    }
    add_action('wp_enqueue_scripts','fix_woo_var_cart');
    Thread Starter jbunger72

    (@jbunger72)

    I tried the solution by placing the code into the functions.php file at the bottom and the script loads just fine, just as the add-to-cart-variations.min.js did and still get the same js error. it’s almost like the $ variable that it’s calling won’t support the .on function, i have not been one for js as I have a pretty hard time getting php and css down…

    the above solution is typically for issues where no error is thrown, so clearly, your problem is something else entirely.

    Probably another plugin conflicting

    Thread Starter jbunger72

    (@jbunger72)

    Any recommendations on how to look at fixing this? I know I can go through and disable plugins an find the one that is conflicting but if this is a simple variable that needs changed or adjusted how would I do that? Or would it be too much code to do it?

    Thread Starter jbunger72

    (@jbunger72)

    I am changing this to resolved… Found out that the theme I use had a different jquery library in it’s own js folder. I took a copy of the 1.7.2 jquery.js file from the wp-includes/js/ folder and placed it in my theme’s js folder. I renamed the themes jquery file which was jquery.min.js to jquery.min.js.old and renamed the copied jquery.js file to the jquery.min.js which basically took its pace updating the jquery for the theme.

    I by no means believe that this is going to be a fix but was what worked for me.

    Thanks for the help.

    thanx

    with jquery.js (1.7.2) my problem solved with renaming

    Wkangaroo

    (@wkangaroo)

    I registered simply because I’m having the same problem and have looked through every thread with the same issues, tried all the suggested fixes and still can’t find the solution.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Variable Product (no add to cart button) js error thrown’ is closed to new replies.