/* Quantity Counter
========================================================*/
;(function ($) {
$(document).on('click', '.counter-minus, .counter-plus', function(e) {
e.preventDefault();
var input = $(this).parent().find('input[name*="quantity"]'),
value = 1;
if ($(this).hasClass('counter-minus') && input.val() > 1) {
value = parseInt(input.val()) - 1;
} else if ($(this).hasClass('counter-plus')) {
value = parseInt(input.val()) + 1;
}
input.val(value);
});
})(jQuery);
<button class="counter counter-minus material-design-horizontal39" href='#'></button>
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>"/>
<button class="counter counter-plus material-design-add186" href='#'></button>