JQuery does not take into account min when using step
-
I’ve been experimenting problems on minus button when value-step<min. I did those changes to solve it.
$('.woocommerce .quantity').on('click', '.minus', function (e) { var qty = $(this).parent().find('input.qty'); var val = parseInt(qty.val()); var step = parseInt(qty.attr('step'));//Modified var min = parseInt(qty.attr('min'));//Modifien if ('undefined' !== typeof (min) || val > min) { step = 'undefined' !== typeof (step) ? parseInt(step) : 1; if (val - step >= min) {//Modified qty.val(val - step).change(); } } });
I did the equivalent ones in the second part of the script.
Hope it helps.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘JQuery does not take into account min when using step’ is closed to new replies.