<div class="quantity-box quantity_category">
<input type="button" id="minus" value="-" class="form-control">
<input type="text" name="quantity" value="1" size="2" id="input-quantity-<?php echo $product['product_id']; ?>" class="form-control input-quantity">
<input type="button" id="plus" value="+" class="form-control">
</div>
<script type="text/javascript"><!--
var minimum = 1;
$(".input-quantity").change(function(){
if ($(this).val() < minimum) {
alert("Minimum Quantity: "+minimum);
$(".input-quantity").val(minimum);
}
});
// increase number of product
function minus(minimum){
var currentval = parseInt($(".input-quantity").val());
$(".input-quantity").val(currentval-1);
if($(".input-quantity").val() <= 0 || $(".input-quantity").val() < minimum){
alert("Minimum Quantity: "+minimum);
$(".input-quantity").val(minimum);
}
};
// decrease of product
function plus(){
var currentval = parseInt($(".input-quantity").val());
$(".input-quantity").val(currentval+1);
};
$('#minus').click(function(){
minus(minimum);
});
$('#plus').click(function(){
plus();
});
//--></script>