DevHub Logo
Home/Blog/WooCommerce Cart Not Updating

WooCommerce 9.6.0 Coupon Error Message Disappears After One Second (Fix Guide)

Motions Studio Team

July 8, 2026

6 min read
WooCommerce cart issue

Coupon Errors Vanish Too Quickly: WooCommerce 9.6.0 Display Bug

After updating to WooCommerce 9.6.0, coupon error messages (e.g., 'Coupon code is invalid' or 'This coupon has expired') are no longer shown as prominent WooCommerce notices at the top of the cart or checkout page. Instead, they appear as a small inline message below the coupon input field and automatically disappear after roughly one second. This change dramatically reduces visibility, causing customers to miss the error and potentially abandon their purchase. The issue stems from a modification in WooCommerce 9.6.0 that altered how coupon-related notices are rendered, likely tied to the newer block-based cart/checkout implementation or a JavaScript auto-dismiss feature. Below we provide a reliable fix to restore persistent coupon error notices.

Step-by-Step Solution

  • 1Ensure WooCommerce is updated to at least 9.6.0 (if you are experiencing this bug, confirming the version is the first step).
  • 2Temporarily switch to the classic shortcode cart/checkout pages (using [woocommerce_cart] and [woocommerce_checkout] shortcodes) to see if the issue persists – this confirms it's related to the block approach.
  • 3Add the provided PHP/JS snippet to your theme's functions.php or via a code snippet plugin (e.g., WPCode).
  • 4Clear any caching plugins (browser, server, CDN) and test by applying an invalid coupon on both the cart and checkout pages.
  • 5If the snippet does not work, check for JavaScript errors in the browser console – a conflicting plugin might be interfering.
  • 6As a fallback, consider using the free 'WooCommerce Customizer' plugin to manage notice display, or temporarily revert to an earlier WooCommerce version (9.5.x) via a staging site.
/**
 * Fix: Prevent coupon error messages from auto-dismissing in WooCommerce 9.6.0+
 * Add to theme's functions.php or a custom plugin.
 */
add_action('wp_footer', 'fix_coupon_error_visibility');
function fix_coupon_error_visibility() {
    if ( ! is_cart() && ! is_checkout() ) {
        return;
    }
    ?>
    <script>
    (function($) {
        $(document).ready(function() {
            // Intercept AJAX completion for coupon actions and stop auto-hide
            $(document).ajaxComplete(function(event, xhr, settings) {
                if ( settings.url && ( settings.url.includes('apply_coupon') || settings.url.includes('remove_coupon') ) ) {
                    // Remove the auto-hide handler that causes the message to disappear
                    $(document.body).off('wc_error_notice_auto_hide');
                    // Also ensure any existing .woocommerce-error or .coupon-error stays visible
                    $('.woocommerce-error, .coupon-error').css({
                        'display': 'block',
                        'opacity': '1',
                        'visibility': 'visible'
                    });
                }
            });
        });
    })(jQuery);
    </script>
    <style>
    /* Force coupon errors to remain visible */
    .woocommerce-cart .woocommerce-error,
    .woocommerce-checkout .woocommerce-error,
    .woocommerce-cart .coupon-error,
    .woocommerce-checkout .coupon-error {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    </style>
    <?php
}

Final Recommendation

Best Practice

This is a confirmed UX regression in WooCommerce 9.6.0. The quickest fix is to add the code above to your theme. If you are uncomfortable editing code, switch your cart and checkout pages to use the classic shortcodes instead of blocks – that solves the issue entirely because the shortcode-based pages maintain the standard notice behavior. Keep an eye on WooCommerce updates, as a permanent fix may be released in a future version. Always test changes on a staging site first, especially if your store is heavily reliant on coupons.

WooCommerce Fixes
Share this guide
M

Motions Studio Team

WordPress developer specializing in debugging, WooCommerce optimization, and PHP compatibility fixes.