Jump to content

Quantity box + -


Recommended Posts

Bonjour

j'ai ajouter la fontionne quantity box dans product-list.tpl

remplacer

 

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}

<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="/{$base_dir}cart.php?add&id;_product={$product.id_product|intval}&token;={$static_token}">{l s='Add to cart'}</a>

{else}

 

 

par:

 

{if ($product.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product.available_for_order AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE}

{if ($product.quantity OR $product.allow_oosp > 0) && $product.customizable != 2}

<label>{l s='Quantity :'}</label>

<input type="text" style="border-radius:4px;width:20px; height:20px; border: solid 1px red; background:#fafafa" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />

<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' }">{l s='Add to cart' }</a>

 

et dans ajax-cart.js

remplacer

 

ajaxCart.add(idProduct, null, false, this);

Replace par

ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val());

 

 

ça marche et le probleme

si je mets -1 dans quantity ça marche aussi

 

comment je peux ajouter ?

:

 

else if(theqty < 1)

{

alert("La quantité commandée ne peut pas être inférieure à 1.")

return;

}

 

 

merci.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...