Dear Support,
I used the code from the below link to update the cart without pressing the “Update Cart” button. The problem is this code is designed for Quantity widgets without +/- buttons. I changed the “Click” event to “Change” event, but now the Quanity widget is updating automatically for Odd numbers (1, 3, 5…)
https://businessbloomer.com/woocommerce-automatically-update-cart-quantity-change/
Below is the code I have put in function.php. Can you please tell me the change to make it work for all quantities.
add_action( ‘wp_footer’, ‘bbloomer_cart_refresh_update_qty’ );
function bbloomer_cart_refresh_update_qty() {
if (is_cart()) {
?>
<script type=”text/javascript”>
jQuery(‘div.woocommerce’).on(‘change’, ‘input.qty’, function(){
jQuery(“[name=’update_cart’]”).trigger(“click”);
});
</script>
<?php
}
}