joanlafulla2 Posted October 16, 2022 Share Posted October 16, 2022 Hi. I'm trying to show the product tags in product.tpl. <ul class="my_tags"> {foreach from=Tag::getProductTags(Tools::getValue('id_product')) key=k item=v} {foreach from=$v key=lang_id item=value} <li><a href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a></li> {/foreach} {/foreach} </ul> The problem is that every tag is showed two times in the different two languages. I would like to filter the tags by language, but the code doesn't work. Link to comment Share on other sites More sharing options...
ps8modules Posted October 16, 2022 Share Posted October 16, 2022 {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> 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