Jump to content

Affichage par Réduction


Recommended Posts

Salut à tout le monde, je me suis lancé sur la création d'une nouvelle fonctionnalité pour ma boutique, mais je bûche un peu. Je cherche à réaliser un affichage par réduction lorsque que  le client clic sur un bouton ce dernier renverra vers les tous les produits à  -50%). 

 

J'ai donc créé un controller, le php puis le tpl, pour l'instant tout est bon ma page s'affiche. Maintenant c'est   le code en lui même sur lequel cela pose problème.

 

j'ai tenté cela mais rien n'y fait.....

 

{if $product.price_without_reduction != $product.price}
     {math equation='1-(x/y)' x=$product.price y=$product.price_without_reduction assign='txreduc'}
     {assign var='txreduc' value=0}
{/if}

     {if $txreduc>0.05}
<li class="ajax_block_product {if $smarty.foreach.specialsFeaturedProducts.first}first_item{elseif $smarty.foreach.specialsFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.specialsFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.specialsFeaturedProducts.iteration%$nbItemsPerLine == 1}first_item_of_line{/if} {if $smarty.foreach.specialsFeaturedProducts.iteration > ($smarty.foreach.specialsFeaturedProducts.total - ($smarty.foreach.specialsFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
     <a href="{$productLink}" title="{$product.legend|escape:htmlall:'UTF-8'}" class="product_image"><img src="{$img_prod_dir}{$product.id_image}-home.jpg" alt="{$product.legend|escape:htmlall:'UTF-8'}" height="129" width="129" />
     {/if}
     {/if}

 

Si quelqu'un peu m'aider pour la structure de  mon code 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...