Update cart without the update button in cart.php
Goes into woocommerce.php or functions.php
/**
* Update cart without the update button in cart.php
*/
function twstudio_cart_update_qty_script() {
if (is_cart()) :
?>
<script>
jQuery('div.woocommerce').on('click', '.qty', function(){
jQuery("[name='update_cart']").removeAttr('disabled');
});
jQuery('div.woocommerce').on('change', '.qty', function(){
jQuery("[name='update_cart']").trigger("click");
});
</script>
<?php
endif;
}
add_action( 'wp_footer', 'twstudio_cart_update_qty_script' );
How would we do it for mini cart.
This plugin looks like it does the job: https://wordpress.org/plugins/woo-ajax-mini-cart/