feature request(my own code)
-
Hello! I found an issues in your plugin:
1) I’m using WooCommerce Quantity Increment plugin. For some reasons if product in stock count for example 2, but customer press “+” button Place Order in cart freezes. So I create little snippet to fix it
var global_val_greater_max;//global function to place into your plugin in at the bottom “wacPostCallback”
function val_greater_max() { //function that checks that input value is equals to max value
$(‘.cart_item’).each(function () {//each container that contains input increment
var max = $(this).find(‘input[type=”number”]’).attr(‘max’);
var val = $(this).find(‘input[type=”number”]’).val();
if (val === max ){
$(this).find(‘input[value=”+”]’).css(‘display’,’none’);//if value equals to max hide “+” button }
else {
$(this).find(‘input[value=”+”]’).css(‘display’,’block’);
}
});
}
val_greater_max();
global_val_greater_max = val_greater_max;
2) If I turn on “Show -/+ buttons around item quantity on cart page” in your plugin, there no any check how much products in stock.Best regards,
Artem Evtihii
- The topic ‘feature request(my own code)’ is closed to new replies.