Patrice97 Posted July 2, 2011 Share Posted July 2, 2011 Bonjour,J’ai un module pour afficher mes nouveaux produits dans le home mais j’aimerais qu’il y est un affichage aléatoire après chaque rafraichissement de page pour ne pas toujours avoir les même produits. Auriez-vous une idée.CordialementMon code ci-dessous: {assign var='products' value=$NewProducts} Nouveautés {foreach from=$products item=product name=products} getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" />{if $product.new == 1}{/if} title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'} {if $product.on_sale} {elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product.reduction_from))}{l s='Price lowered!' mod='wdanewshome'} {/if} {if !$priceDisplay}{convertPrice price=$product.price}{else} {convertPrice price=$product.price_tax_exc}{/if} <!-- {if ($product.allow_oosp OR $product.quantity > 0)}{l s='Available' mod='wdanewshome'}{else}{l s='Out of stock' mod='wdanewshome'}{/if} --> {/foreach} {l s='All new products' mod='wdanewshome'} [/color] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now