Для PrestaShop 1.5, стандартная тема.
1. в файле ajax-cart.js
После кода
//for product page 'add' button...
$('#add_to_cart input').unbind('click').click(function(){
ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
return false;
});
добавьте :
//for list product page 'add' button...
$('ul#product_list .ajax_add_to_cart_button').unbind('click').click(function(){
var idProduct = $(this).attr('rel').replace('ajax_id_product_', '');
if ($(this).attr('disabled') != 'disabled')
ajaxCart.add(idProduct, null, false, this,$('#quantity_wanted_'+ idProduct).val());
return false;
});
2. в файле product-list.tpl
После кода, линия 58:
{if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE
}
перед
{if isset($static_token)}
добавить код:
<!-- START quantity wanted -->
<p class="erh-quantite-produit" {if (!$allow_oosp && $product.quantity <= 0) OR $virtual OR !$product.available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity:'}</label>
<input type="text" name="qty" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product.minimal_quantity > 1}{$product.minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product.minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product.minimal_quantity});"{/if} />
</p>
<!-- END quantity wanted -->