Update Cart button in woocommerce always stuck at not clickable / disabled. How to fix?

View QuestionsCategory: QuestionsUpdate Cart button in woocommerce always stuck at not clickable / disabled. How to fix?
admin Staff asked 7 months ago
1 Answers
admin Staff answered 7 months ago

Use jquery and set enabled at set interval. You may need to change selector to make it work for your website.
Code here:


add_action( 'woocommerce_before_cart', 'update_cart_force_enable' );
function update_cart_force_enable(){
    ?>
    <script>
jQuery(document).ready(function ()
{
	setInterval(
		function ()
		{
			if (jQuery("[name=update_cart]").prop("disabled"))
			{
				jQuery("[name=update_cart]").prop("disabled", false);
			}
		}, 1000);
});
    </script>
    <?
}
admin Staff replied 7 months ago

visualize the cart hooks reference here – https://businessbloomer.com/woocommerce-visual-hook-guide-cart-page/

admin Staff replied 7 months ago

To get the js hook for other cart-update related actions, do this

jQuery( function($){
$(document.body).on(‘updated_cart_totals’, function () {

});
});

Source: https://stackoverflow.com/questions/57663997/get-woocommerce-refreshed-cart-total-on-updated-cart-totals-jquery-event