Nazo Posted August 18, 2011 Share Posted August 18, 2011 Hello everybody, I'm a little embarrassed to ask for your help. In fact, I do a prestashop website and I must admit that I do not touch Smarty. I just go around and modify the html and css around it. Now, I have a problem. I tried all afternoon but I really don't manage. Here is my code. It corresponds to a module prestashop that I am changing: <div id="cadre-nouveautes"> {if $new_products !== false} {foreach from=$new_products item='product' name='newProducts'} {foreach from=$new_products item=newproduct name=myLoop} <div class="image-nouveau-produit"> <a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a> </div> <div class="lien-nouveau-produit"> <a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a> </div> {/foreach} {/foreach} <div class="clear"></div> <div class="lien-tous-nouveaux-produits"> <p><a href="{$link->getPageLink('new-products.php')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">{l s='All new products' mod='blocknewproducts'}</a></p> {else} <p>{l s='No new products at this time' mod='blocknewproducts'}</p> {/if} </div> </div> <!-- /MODULE Block new products --> My problem is that it should give me 3 lines. Or give me ca 9. The results are tripled when they should not. I enclose a picture of what I have and what I want. Could you help me please? Thanks in advance. Best Regards Bruno Link to comment Share on other sites More sharing options...
jeevanoss Posted August 18, 2011 Share Posted August 18, 2011 Remove one foreach loop {foreach from=$new_products item='product' name='newProducts'} <div class="image-nouveau-produit"> <a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a> </div> <div class="lien-nouveau-produit"> <a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a> </div> {/foreach} Link to comment Share on other sites More sharing options...
Mike Kranzler Posted August 18, 2011 Share Posted August 18, 2011 Hi Nazo, I hope jeevanoss was able to help you with your issue, but most importantly, please don't feel embarrassed to ask for help here on the forums. We've got thousands of developers asking and answering questions here every day, and we're glad to have you here. -Mike 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