Jump to content

Problem to modify the blocknewproducts


Recommended Posts

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

 

cadrenouveautesvoulu.gif

cadrenouveautesreel.gif

Link to comment
Share on other sites

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

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...