WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Variable Product (no add to cart button) js error thrown (8 posts)

  1. jbunger72
    Member
    Posted 1 year ago #

    Didn't get js errors with previous woocomerce but didn't have an add to cart button on a variable product. Now I updated to 1.6.6 to see if it would correct the missing button and am getting a js error on IE9, debug console says SCRIPT438: Object doesn't support property or method 'on'

    I have tried other fixes for the missing button to no avail.

    Anyone have any ideas?

    link t0 variable product.
    http://kearneymedia.net/kearneymedia/shop/dvd-blu-ray-cases/standard-dvd-case-black/

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year ago #

    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');
  3. jbunger72
    Member
    Posted 1 year ago #

    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...

  4. bheadrick
    Member
    Posted 1 year ago #

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

    Probably another plugin conflicting

  5. jbunger72
    Member
    Posted 1 year ago #

    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?

  6. jbunger72
    Member
    Posted 1 year ago #

    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.

  7. gufranchorghay
    Member
    Posted 1 year ago #

    thanx

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

  8. Wkangaroo
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.