+ - problem in product page are done
product.tpl
<div class="product_attributes clearfix"> <!-- quantity wanted --> {if !$PS_CATALOG_MODE} {assign cat16 [['id_category' => 16]]} {if Product::idIsOnCategoryId($smarty.get.id_product, $cat16)} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="1" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_1"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_1"> <span><i class="icon-plus"></i></span> </a> </p> {else} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="number" min="1" name="qty" id="quantity_wanted" disabled="disabled" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_2"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up_2"> <span><i class="icon-plus"></i></span> </a> <span class="clearfix"></span> </p> {/if} {/if}
product.js
// The button to increment the product value $(document).on('click', '.product_quantity_up_1', 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); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_1', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 1) $('input[name='+fieldName+']').val(currentVal - 1).trigger('keyup'); else $('input[name='+fieldName+']').val(1); $('#quantity_wanted').change(); }); // The button to increment the product value $(document).on('click', '.product_quantity_up_2', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseFloat($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 0.5).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_2', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseFloat($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 0.5) $('input[name='+fieldName+']').val(currentVal - 0.5).trigger('keyup'); else $('input[name='+fieldName+']').val(0.5); $('#quantity_wanted').change(); });