mina.n Posted December 11, 2012 Share Posted December 11, 2012 Bonjour, voici mon probleme, j'ais la template wareshouse et voici comment le fichier product.tpl est dispose, j'ais bidouille un peu et pour les prix unitaire s'affiche selon le pourcentage, cela a marche. Cependant j'aimerais afficher la quantite des facons diferrente comme ceci: 1-9 10-99 je n'y arrives pas pas voici mon code, si quelqu'un pourrais m'aider ca serais cool. Merci <thead> <tr> <th>{l s='product'}</th> <th>{l s='from (qty)'}</th> <th>{l s='to'}</th> <th>{l s='discount'}</th> <th>{l s='Price'}</th> </tr> </thead> <tbody> {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} <tr id="quantityDiscount_{$quantity_discount.id_product_attribute}"> <td> {if (isset($quantity_discount.attributes) && ($quantity_discount.attributes))} {$product->getProductName($quantity_discount.id_product, $quantity_discount.id_product_attribute)} {else} {$product->getProductName($quantity_discount.id_product)} {/if} </td> <td> {$quantity_discount.quantity|intval} </td> <td> {assign var='prodNb' value=0} {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} {if $prodNb==0} {if $quantity_discount.quantity==2}[/size][/font][/color] [color=#343943][font=Arial, Helvetica, sans-serif][size=3] {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} {/foreach} {l s='Quantity'} {l s='for'} {else} {l s='from'} 1 {l s='to'} {/if} {/if} {$quantity_discount.quantity-1|intval} {assign var='prodNb' value=$prodNb+1} {l s='from'} {$quantity_discount.quantity|intval} {l s='to'} {/foreach} ∞ </td> <td> {if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'} -{convertPrice price=$quantity_discount.real_value|floatval} {else} -{$quantity_discount.real_value|floatval}% {/if} </td> <td> {assign var='prixProduct' value=$product->getPrice(true, $smarty.const.NULL, 2)} {convertPrice price=$prixProduct-$prixProduct*$quantity_discount.real_value/100|floatval} <!-- calcule du prix unitaire --> </td> </tr> {/foreach} Link to comment Share on other sites More sharing options...
Patric Posted December 12, 2012 Share Posted December 12, 2012 Salut mina.n, Merci de pster dans la bonne section. Topic fermé. Link to comment Share on other sites More sharing options...
Recommended Posts