Home › Forums › WoodMart support forum › page should not refresh when “qty” field is empty
page should not refresh when “qty” field is empty
- This topic has 7 replies, 2 voices, and was last updated 8 months, 2 weeks ago by
Luke Nielsen.
-
AuthorPosts
-
March 3, 2025 at 6:03 pm #642429
kidsdial4ParticipantWhen 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.
March 4, 2025 at 10:46 am #642569
Luke NielsenMemberHello,
Disable the “Update cart on quantity change” in Theme Settings -> Shop -> Cart -> https://prnt.sc/5mStVWk6J4Kp
Then recheck the issue.
Kind Regards
March 4, 2025 at 12:17 pm #642611
kidsdial4ParticipantHi,
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”
March 5, 2025 at 1:27 pm #642990
Luke NielsenMemberHello,
In the 8.2 update, we will consider how to make it better.
Thank you for your suggestion.
Kind Regards
March 5, 2025 at 1:36 pm #642994
kidsdial4ParticipantHi,
the same issue in our website also.
client is telling me to resolve the issue, please make some time and look into it.
March 5, 2025 at 5:29 pm #643137
Luke NielsenMemberHello,
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
March 6, 2025 at 5:02 pm #643534
kidsdial4Participanti 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.
March 7, 2025 at 12:34 pm #643792
Luke NielsenMemberHello,
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
-
AuthorPosts
- You must be logged in to create new topics. Login / Register
