kbytin Posted March 19, 2014 Share Posted March 19, 2014 How can I add tags of product to product.tpl? I'm using PS 1.6 now. Thanx Link to comment Share on other sites More sharing options...
vekia Posted March 20, 2014 Share Posted March 20, 2014 tutorial: product tags on product page works also in prestashop 1.6 1 Link to comment Share on other sites More sharing options...
kbytin Posted March 25, 2014 Author Share Posted March 25, 2014 Thanx! Link to comment Share on other sites More sharing options...
HavanA Posted August 18, 2014 Share Posted August 18, 2014 Nice tutorial. Thanks. I would like to add a little margin at the bottom (or should I add it at top?). Where should I add that? Link to comment Share on other sites More sharing options...
HavanA Posted August 20, 2014 Share Posted August 20, 2014 Anyone? Maybe some margin to add above the product picture? I tried adding some margin in the labels, but it does not add it between the labels, only above the area with the labels itself. Link to comment Share on other sites More sharing options...
nickosn Posted December 18, 2015 Share Posted December 18, 2015 tutorial: product tags on product page works also in prestashop 1.6 Hi vekia! Thanks for the tutorial. How can I add category id to the link so that the search is done in the same category that the product is ? Kind Regards Link to comment Share on other sites More sharing options...
MPenseur Posted December 18, 2015 Share Posted December 18, 2015 Really nice tutorial ! Link to comment Share on other sites More sharing options...
nickosn Posted January 16, 2016 Share Posted January 16, 2016 Seemed that this more Hi vekia! Thanks for the tutorial. How can I add category id to the link so that the search is done in the same category that the product is ? Kind Regards Seems that is more difficult that I first thought. I hired a programmer to implent this. Working fine now Link to comment Share on other sites More sharing options...
Marek_O Posted August 12, 2016 Share Posted August 12, 2016 (edited) The tutorial is not complete ... if you have multiple languages, all tags will appear, thats not wanted usually ...Instead, add this to product.tpl: (prestashop 1.6) <div class="tags_block">Tags: <div class="block_content"> {assign var=tags value=Tag::getProductTags(Tools::getValue('id_product'))} {assign var=lang value=intval(Context::getContext()->cookie->id_lang)} {foreach from=$tags.$lang item=value} <a class="tag_level1 item" target="_blank" href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a> {/foreach} </div> </div> We first assign all tags (tags are saved in arrays, each array for one language) to a variable and then another variable for the current user language. Then add all tags for the current language id ...The style will be like your standard Prestashop styled tags coming from "tags_block" class and "tag_level1 item" classes.But you can change it to your own CSS if you want ... Edited August 12, 2016 by Marek_O (see edit history) 1 Link to comment Share on other sites More sharing options...
dmr-electronics Posted October 1, 2016 Share Posted October 1, 2016 Is their a way to hide the tags code when No tags are available for a couple products. Is it something with if argument? Can someone provide the script. Thanks. Link to comment Share on other sites More sharing options...
S4nG0 Posted February 7, 2017 Share Posted February 7, 2017 The tutorial is not complete ... if you have multiple languages, all tags will appear, thats not wanted usually ... Instead, add this to product.tpl: (prestashop 1.6) <div class="tags_block">Tags: <div class="block_content"> {assign var=tags value=Tag::getProductTags(Tools::getValue('id_product'))} {assign var=lang value=intval(Context::getContext()->cookie->id_lang)} {foreach from=$tags.$lang item=value} <a class="tag_level1 item" target="_blank" href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a> {/foreach} </div> </div> We first assign all tags (tags are saved in arrays, each array for one language) to a variable and then another variable for the current user language. Then add all tags for the current language id ... The style will be like your standard Prestashop styled tags coming from "tags_block" class and "tag_level1 item" classes. But you can change it to your own CSS if you want ... This helped a lot! Browsed the forum for ages before I found this! Thanks! Link to comment Share on other sites More sharing options...
redrum Posted February 25, 2017 Share Posted February 25, 2017 Is their a way to hide the tags code when No tags are available for a couple products. Is it something with if argument? Can someone provide the script. Thanks. You can try this. It seems to work in 1.7 <div class="block_content"> {assign var=tags value=Tag::getProductTags(Tools::getValue('id_product'))} {assign var=lang value=intval(Context::getContext()->cookie->id_lang)} {if $tags.$lang} <div class="tags_block">Tags: {foreach from=$tags.$lang item=value} <a class="tag_level1 item" target="_blank" href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a> {/foreach} {/if} </div> </div> Link to comment Share on other sites More sharing options...
Recommended Posts