попробовал исправить свой код
html в браузере выглядит:
<p class="quantity_wanted_p" style="display: inline;">
<input type="text" name="ajax_qty_to_add_to_cart[78]" id="quantity_wanted_78" class="text" value="1" size="2" maxlength="3">
<a href="#" data-field-qty="ajax_qty_to_add_to_cart[78]" class="btn btn-default button-minus product_quantity_down">
<span>
<i class="fa fa-minus"></i>
</span>
</a>
<a href="#" data-field-qty="ajax_qty_to_add_to_cart[78]" class="btn btn-default button-plus product_quantity_up">
<span>
<i class="fa fa-plus"></i>
</span>
</a>
</p>
js:
// The button to increment the product value
$(document).on('click', '.product_quantity_up', function(e){
e.preventDefault();
fieldName = $(this).data('field-qty');
var currentVal = parseInt($('input[name='+fieldName+']').val());
if (!allowBuyWhenOutOfStock && quantityAvailable > 0)
quantityAvailableT = quantityAvailable;
else
quantityAvailableT = 100000000;
if (!isNaN(currentVal) && currentVal < quantityAvailableT)
$('input[name='+fieldName+']').val(currentVal + 1).trigger('keyup');
else
$('input[name='+fieldName+']').val(quantityAvailableT);
});
// The button to decrement the product value
$(document).on('click', '.product_quantity_down', function(e){
e.preventDefault();
fieldName = $(this).data('field-qty');
var currentVal = parseInt($('input[name='+fieldName+']').val());
if (!isNaN(currentVal) && currentVal > 1)
$('input[name='+fieldName+']').val(currentVal - 1).trigger('keyup');
else
$('input[name='+fieldName+']').val(1);
});
Что не так?