Hello,
Thanks for the heads-up on this. Unfortunately, the current code does not account for the Min/Max values. To fix this, please replace the entire cartQuantity: function() Function Block with the following code:
cartQuantity: function(){
$(".plus").off( 'click' ).on( 'click', function(){
var quantity = $(this).parents('.quantity').find('.qty'),
productQuantity = quantity.val(),
quantityStep = quantity.attr('step'),
quantityMax = quantity.attr('max'),
intRegex = /^\d+$/;
if( !quantityStep ) { quantityStep = 1; }
if( quantityMax && ( Number(productQuantity) >= Number( quantityMax ) ) ) { return false; }
if( intRegex.test( productQuantity ) ) {
var productQuantityPlus = Number(productQuantity) + Number(quantityStep);
quantity.val( productQuantityPlus ).change();
} else {
quantity.val( Number(quantityStep) ).change();
}
return false;
});
$(".minus").off( 'click' ).on( 'click', function(){
var quantity = $(this).parents('.quantity').find('.qty'),
productQuantity = quantity.val(),
quantityStep = quantity.attr('step'),
quantityMin = quantity.attr('min'),
intRegex = /^\d+$/;
if( !quantityStep ) { quantityStep = 1; }
if( !quantityMin ) { quantityMin = 1; }
if( intRegex.test( productQuantity ) ) {
if( Number(productQuantity) > Number( quantityMin ) ) {
var productQuantityMinus = Number(productQuantity) - Number(quantityStep);
quantity.val( productQuantityMinus ).change();
}
} else {
quantity.val( Number(quantityStep) ).change();
}
return false;
});
},
This should definitely work fine. Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.