#1 Hide update cart button
.woocommerce button[name="update_cart"], .woocommerce input[name="update_cart"] { display: none; }
#2 Create a file named update-cart.js
jQuery( function( $ ) { $('.woocommerce').on('change', 'input.qty', function(){ $("[name='update_cart']").trigger("click"); }); });
#3 Enqueue it only on cart and checkout page
// CART function add_custom_scripts() { if( is_cart() ) { wp_enqueue_script( 'update-cart-js', get_stylesheet_directory_uri() . '/assets/js/update-cart.js' ); } add_action( 'wp_enqueue_scripts', 'add_custom_scripts' );
Leave a Reply