SkyHiRider Posted November 17, 2013 Share Posted November 17, 2013 Which function do I need to call to check if a product has a specific tag?I need to add a specific html code to a product ONLY if the product has one or more specific tags set in the backoffice. I have found the .tpl file but I dont know for what variable I need to check so that my {if } {/if} statement is only active when a product is tagged as "stamp". Can anyone give me any advice? Link to comment Share on other sites More sharing options...
vekia Posted November 17, 2013 Share Posted November 17, 2013 use something like: {foreach from=Tag::getProductTags(Tools::getValue('id_product')) key=k item=v} {foreach from=$v item=value} {if $value=="MY TAG"} {l s='This produt has got MY TAG'} {/if} {/foreach} {/foreach} Link to comment Share on other sites More sharing options...
pietruzzo Posted May 15, 2023 Share Posted May 15, 2023 Ten years after, thank you. Really appreciated. 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