Show Every Variation Clearly – Add Extra Images Free Download

Add to cart button appears disabled

Hi, we are experiencing an issue on the frontend where the “Add to cart” button appears disabled and does not allow adding products to the cart, even though the product has stock available and a valid price.

Thank you.

<button type=”submit” class=”single_add_to_cart_button button alt” disabled>ADD TO CART</button>

I’m sharing this temporary fix in case it happens to anyone else. It works well on my site. Just add the code to functions.php.

/**
 * TEMP FIX – Force products to be purchasable
 */
 
add_action(‘wp_footer’, function () {
  if ( ! is_product() ) return;
  ?>
  <script>
    (function() {
      function enableAddToCart() {
        document.querySelectorAll(
          ‘button.single_add_to_cart_button[disabled], button.single_add_to_cart_button.disabled’
        ).forEach(function(btn){
          btn.disabled = false;
          btn.removeAttribute(‘disabled’);
          btn.classList.remove(‘disabled’);
        });
      }
 
      // Run once on page load
      enableAddToCart();
    })();
  </script>
  <?php
}, 9999);

Golam Kibria

Hi Carla,

Apologies for the inconvenience.

Thanks a lot for sharing this snippet.

We will notify you when an official update is released.

Thank You

Golam Kibria

Hi Carla,

We have released an update for the premium version.

Updating to the latest version (2.2.3) will resolve the disabled Add to Cart button issue.

I will wait for your feedback.

Thank you