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);
Add to cart button appears disabled
Carla Ravagnani
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>