Fixing the WooCommerce 10.5 Disabled Add to Cart Button

WooCommerce 10.5 just dropped, and if you are a developer who likes a clean asset list, you might have unintentionally broken your variable product pages. The latest WooCommerce 10.5 Add to Cart button change introduces a deliberate hurdle: the button is now disabled by default for variable products until the variation script has fully initialized.

I have seen race conditions kill checkout conversions more times than I care to count. Previously, on high-latency connections, a user could select an attribute and mash the button before the JavaScript logic was ready to handle the submission. This led to failed “Add to Cart” actions and frustrated customers. To solve this, the core team added a disabled attribute directly to the template.

Why the WooCommerce 10.5 Add to Cart button is now disabled

The logic is simple but creates a major “gotcha” for legacy themes. In version 10.5, the variation-add-to-cart-button.php template now ships with the disabled attribute hardcoded. Specifically, the core add-to-cart-variation.js script is responsible for removing this attribute once the variations are loaded and ready for interaction.

However, many of us refactor our sites by dequeuing default WooCommerce scripts to reduce bloat or to use custom variation logic. If you have dequeued the default variation script but are still using the core template, your WooCommerce 10.5 Add to Cart button will stay grayed out forever. This is exactly the kind of “messy” reality we deal with when core updates collide with custom optimizations.

Furthermore, if you are looking at performance holistically, you should also check out my guide on WooCommerce Variation Price Caching, which covers another critical update in this release.

How to tell if your store is affected

You are likely facing a bottleneck if your store meets these three criteria:

  • You utilize variable products.
  • You have dequeued /client/legacy/js/frontend/add-to-cart-variation.js.
  • You have not overridden the variation-add-to-cart-button.php template in your theme.

The Fix: Refactoring Your Custom Script

To fix the WooCommerce 10.5 Add to Cart button, you must update your custom JavaScript to handle the removal of the disabled attribute. You should trigger this once your own variation logic has finished initializing. Here is a clean way to do it using Vanilla JS:

/**
 * Fix for WooCommerce 10.5 disabled Add to Cart button.
 * Ensure this runs after your custom variation logic initializes.
 */
document.addEventListener('DOMContentLoaded', function() {
    const variationForm = document.querySelector('.variations_form');
    
    // If you are using custom events, listen for them here
    variationForm.addEventListener('wc_variation_form_initialized', function() {
        const cartButton = variationForm.querySelector('.single_add_to_cart_button');
        if (cartButton) {
            cartButton.removeAttribute('disabled');
            console.log('WooCommerce 10.5 Add to Cart button enabled.');
        }
    });
});

Consequently, if you are using jQuery (as many legacy Woo setups still do), you can hook into the wc_variation_form event to ensure the button is interactive at the right moment. Therefore, the goal is to mirror the behavior that the core script now expects.

Look, if this WooCommerce 10.5 Add to Cart button stuff is eating up your dev hours, let me handle it. I’ve been wrestling with WordPress since the 4.x days.

Final Takeaway for Developers

The WooCommerce 10.5 Add to Cart button update is a win for stability but a headache for those of us maintaining high-performance custom builds. Moving forward, always verify your wp_dequeue_script calls against core template changes after a major update. If you are using the new Add to Cart + Options block, you are safe from this specific issue, as it uses a different logic stack entirely. Ship it, but test your variable products first.

author avatar
Ahmad Wael
I'm a WordPress and WooCommerce developer with 15+ years of experience building custom e-commerce solutions and plugins. I specialize in PHP development, following WordPress coding standards to deliver clean, maintainable code. Currently, I'm exploring AI and e-commerce by building multi-agent systems and SaaS products that integrate technologies like Google Gemini API with WordPress platforms, approaching every project with a commitment to performance, security, and exceptional user experience.

Leave a Comment

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