We are the ones who have created an e-commerce website with WordPress WooCommerce. Increasing or decreasing the quantity of a product on the default cart page, its price is not updated automatically. It has to be updated manually.
In today’s post, we will learn How to Add WooCommerce Auto Update Cart on Quantity Change.
Install Simple Custom CSS and JS Free Plugin
Themes you are using on your WordPress WooCommerce website must have “custom CSS and custom js.” If not, there is no problem. We can continue working using a plugin. The name of the plugin is Simple Custom CSS and JS. You can download and upload from here if you want. Or you can install it from the WordPress dashboard.

Login to the dashboard of your WordPress website to install the plugin. Click Add New, then type Simple Custom CSS and JS in the search bar, then install and activate from the plugin. OK, we have successfully installed the Simple Custom CSS and JS plugin.

Hide Update Cart Button
To hide the update cart button, copy the CSS code below, paste it into custom CSS, and click publish. Refresh the cart page again. OK, we were able to hide the update cart button successfully.
.woocommerce button[name="update_cart"],
.woocommerce input[name="update_cart"] {
display: none !important;
}

Add Auto Update Cart Function
Copy and paste the JS code below into the custom JS and click Publish to add the Auto Update Cart Function. OK, we were able to add the Add Auto Update Cart Function successfully.
var timeout;
jQuery( function( $ ) {
$('.woocommerce').on('change', 'input.qty', function(){
if ( timeout !== undefined ) {
clearTimeout( timeout );
}
timeout = setTimeout(function() {
$("[name='update_cart']").trigger("click");
}, 500 ); // 1 second delay, half a second (500) seems comfortable too
});
} );

You can read our other WordPress posts
- How To Add A Buy Now Button. Send People Directly To Checkout WooCommerce
- How To Add Web Push Notifications To Your Blogger Website Free
- How To Add Dark Mode in WordPress Free Method
- How to Add OTP Based Two Factor Authentication in WordPress for Free
I hope this post will be helpful for you. If you like it, please share the post. If there is any problem, please comment. I will try to solve it.
The post has been great. I want more posts like this. I will add Auto Update Cart to my ecommerce site today
It’s an amazing piece of writing in support of all the web
users; they will get advantage from it I am sure.
Very nice!
Thank you!