Home Forums WoodMart support forum page should not refresh when “qty” field is empty

page should not refresh when “qty” field is empty

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #642429

    kidsdial4
    Participant

    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

    #642569

    Luke Nielsen
    Keymaster

    Hello,

    Disable the “Update cart on quantity change” in Theme Settings -> Shop -> Cart -> https://prnt.sc/5mStVWk6J4Kp

    Then recheck the issue.

    Kind Regards

    #642611

    kidsdial4
    Participant

    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”

    #642990

    Luke Nielsen
    Keymaster

    Hello,

    In the 8.2 update, we will consider how to make it better.

    Thank you for your suggestion.

    Kind Regards

    #642994

    kidsdial4
    Participant

    Hi,

    the same issue in our website also.

    client is telling me to resolve the issue, please make some time and look into it.

    #643137

    Luke Nielsen
    Keymaster

    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

    #643534

    kidsdial4
    Participant

    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.

    #643792

    Luke Nielsen
    Keymaster

    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

Viewing 8 posts - 1 through 8 (of 8 total)