• Resolved Vince

    (@vincentrich)


    I am using WooCommerce Version 3.4.5.

    I noticed that the AJAX calls for the apply coupon and remove coupon on my checkout page are not working 100%. The AJAX calls are being called correctly but they fail to update the review order table with the discounts and order totals.

    I decided to investigate the woocommerce/assets/js/frontend/checkout.js file. I enabled WooCommerce to use this file instead of the min.js version by editing this line in class-wc-frontend-scripts.php.

    'wc-checkout'                => array(
    				'src'     => self::get_asset_url( 'assets/js/frontend/checkout.js' ),

    This allowed me to edit the code in checkout.js to debug.

    I discovered that the wc_checkout_coupons object has two functions, submit and remove_coupon that do not seem to be able to get the if(code) condition to run after a successful AJAX call.

    If I comment out the if(code) condition, the checkout page apply and remove coupon features work perfectly.

    Therefore, my question is. Why is the if(code) condition not working? Any idea what I can do to fix this issue without editing checkout.js?

Viewing 1 replies (of 1 total)
  • Plugin Support John Coy a11n

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @vincentrich

    Typically issues like this are caused by a theme or plugin conflict. Try switching back to a default theme like Twenty Seventeen and disable all plugins except for WooCommerce to see if this resolves the coupon issue.

    If so, then re-enable each one at a time until you find the one that’s causing the conflict.

Viewing 1 replies (of 1 total)
  • The topic ‘Apply and Remove Coupon AJAX on Checkout Page Not Working’ is closed to new replies.