Jump to content

[Résolu] Problème d'affichage block nouveaux produits thème black & white


Enduro

Recommended Posts

Bonjour,

J'ai un léger problème avec le block nouveaux produits du thème black & white.

Ce block affiche les 4 derniers nouveaux produits, le souci est que lorsque l'on à qu'un seul nouveau produit ou deux ou trois il y a un problème d'affichage.

ex: pour un seul nouveau produit

Le nouveau produit s'affiche bien mais aux emplacements du dessous il y a un carré avec point d’interrogation (pas d'image) qui a comme lien la page d’accueil voir photo.

Je pense qu'il manque une condition si nouveau produit .... mais je ne sais pas quoi mettre si quelqu'un peux m'aider.

Voici le fichier tpl

<!-- MODULE Block new products -->


{l s='New products' mod='blocknewproducts'}

   {if $new_products}
           {foreach from=$new_products item=product name=myLoop}
       {/foreach}






{$new_products.0.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.0.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}








{$new_products.1.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.1.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}








{$new_products.2.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.2.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}








{$new_products.3.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.3.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}


        {else}

{l s='No new product at this time' mod='blocknewproducts'}
   {/if}

<!-- /MODULE Block new products -->

40338_ZrBIIN6QQwKakaVFwHQ3_t

Link to comment
Share on other sites

Je continu mon monologue mais avec la solution.

Voici le code corrigé:

<!-- MODULE Block new products -->


{l s='New products' mod='blocknewproducts'}

   {if $new_products.0}
           {foreach from=$new_products item=product name=myLoop}
       {/foreach}






{$new_products.0.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.0.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}


{else}

{l s='No new product at this time' mod='blocknewproducts'}
   {/if}

   {if $new_products.1}






{$new_products.1.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.1.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}


   {/if}

   {if $new_products.2}






{$new_products.2.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.2.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}


   {/if}

   {if $new_products.3}






{$new_products.3.name|escape:htmlall:'UTF-8'|truncate:38}

           {if $product.description_short}

{$new_products.3.description_short|strip_tags:htmlall:'UTF-8'|truncate:90}
           {/if}


   {/if}

<!-- /MODULE Block new products -->

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