WooCommerce gives us by default functionality to update the cart with the button, but what do you think – would it be better if the cart will be updated automatically. Automatically mean when you change the quantity of a product then it will update cart subtotal automatically.
So, let’s start to Remove Update Cart button with just add a couple of lines of code in your .css and .js files OR your theme’s functions.php file (I suggest to use child theme). It is easy to play with code and make a hook to do this.
Method 1 (Using .css and .js files):-
In this method, we will use only .css and .js files that are connected to the frontend.
Look at this CSS code –
Add above CSS code in your style.css file and save it. Here I would like to tell you that, we will just hide or disable the cart button and we cannot remove this button because of some JS functions triggers with this button.
And the next step we will also trigger the event on this button while changing the quantity of the product. And you will see the auto-update cart page.
Look at this jQuery code –
Add this above code in your .js file and save it. And Done!
NOTE:- You can also add above CSS and jQuery code in header.php OR footer.php file with using the HTML style and script tag.
Method 2 (Using functions.php files):-
In this method, to remove update cart button, we will use the theme’s functions.php file. We will make a hook function to add all the above code in the Header OR Footer of the website.
As I already mentioned above you can also use the header.php OR footer.php file directly but here we will hit the wp_footer hook in the functions.php file to do this.
Look at this WordPress Hook –