Jump to content

Recommended Posts

Hello, svp j'ai un problème que j'arrive pas à résoudre:

Je suis sous prestashop 1.7.x et je cherche à afficher les tags enregistrer dans l'onglet "Options"  sur ma fiche produit. Voici le code que j'ai ajouté sur mon product.tpl mais on me dit Code Iso incorrect ! 

Si quelqu'un à un solution ou autre méthode sous la version 1.7.x

Merci

{assign var='id_lang' value=Language::getIdByIso($lang_iso)}
                    {assign var='productTags' value=$product->tags}
                    {l s='Ce produit a les tags suivant :'}
                    {foreach from=$productTags[$id_lang] item=productTag name=productTags}
                        <a href="{$base_dir}index.php?controller=search&tag={$productTag|escape:'url'}"><strong>{$productTag}</strong></a>{if !$smarty.foreach.productTags.last}, {/if}
                    {/foreach}

Share this post


Link to post
Share on other sites
52 minutes ago, rachel01 said:

Bonjour,

 

Avez-vous trouvé une solution ?
Merci

Essayez  plutôt  ceci :

{assign  var=tags   value=Tag::getProductTags($product->id)}
{assign  var=id_lang  value=Context::getContext()->language->id}
{assign  var=product_tags   value=$tags[$id_lang] }

<ul>
    {foreach from=$product_tags key=k item=v}
        {foreach from=$v item=value}
            <li><a href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a></li>
        {/foreach}
    {/foreach}
</ul>

 

Edited by ndiaga (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More