how to update cart automatically in WooCommerce cart page when change product quantity.I added some code to make my product price change when the product quantity on my cart page changes, I added this code to my wp-footer hook but found it is not correct, please help I’ll check why, thanks
This is the code I am adding:
jQuery( function( $ ) {
$(‘.woocommerce’).on(‘change’, ‘input.qty’, function(){
$(“[name=’update_cart’]”).trigger(“click”);
});
} );
Here is the link to the screenshot of the image displayed on my website after I added the code:https://i.postimg.cc/hjgVYrP0/cart-update.jpg