page should not refresh when “qty” field is empty
-
When the Qty field is blank, than it should not refresh the page until user enter some number.
Currently when the “QTY” field is blank, it ll update the cart automatically. but it should not refresh page. please help for this.
https://jumpshare.com/v/qRdOqRxtiSqjpnEWpS0d
Hello,
Disable the “Update cart on quantity change” in Theme Settings -> Shop -> Cart -> https://prnt.sc/5mStVWk6J4Kp
Then recheck the issue.
Kind Regards
Hi,
If i disable that option, than auto-refresh ll not happend when i increase “qty” using “+” or “-” symbol.
Please give me the code for not to update the page when the “qty” field is “blank”
Hello,
In the 8.2 update, we will consider how to make it better.
Thank you for your suggestion.
Kind Regards
Hi,
the same issue in our website also.
client is telling me to resolve the issue, please make some time and look into it.
Hello,
Disable this https://monosnap.com/file/0SU425irrMykMqk1fvctICRYDxdOo5 script in Theme Settings -> Performance -> JS -> Advanced scripts controls.
And add the code below in Theme Settings -> Custom JS -> On document ready:
var timeoutCart;
woodmartThemeModule.$document.on('change input', '.woocommerce-cart-form__cart-item .quantity .qty', function(e) {
var $input = $(this);
clearTimeout(timeoutCart);
if ($input.val().trim() === '') {
return;
}
timeoutCart = setTimeout(function() {
$input.parents('.woocommerce-cart-form').find('button[name=update_cart]').trigger('click');
}, 500);
});
Kind Regards
i have updated your code and now once we increase or decrease the “qty” using “+” or “-” symbol, than it is not refreshing the page automatically. please resolve this.
Hello,
You have pasted the code with the mistake, so we have fixed that and now it works. Please recheck it and let me know.
Kind Regards