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 4 years ago
1 Answers
admin Staff answered 4 years 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 4 years ago

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

admin Staff replied 4 years 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