charlie123 Posted February 22, 2012 Share Posted February 22, 2012 Hello, I have edited one of the free modules to display additional tab on product page, but I want this tab to be displayed only if product is placed in specific category (eg cat id 3) All I need is "IF" code formula. Im not a coder and I don't know what formula need to be used. Basically I need something like this: {if $product is placed in category id 3 ->display content from below} <--- what is the correct code for this? <li><a href="#msTabHolder" class="idTabHrefShort">{l s='Extra tab' mod='productcomments'}</a></li> {/if} Thank you Link to comment Share on other sites More sharing options...
bellini13 Posted February 22, 2012 Share Posted February 22, 2012 you could try {if $product->id_category_default==3} <li><a href="#msTabHolder" class="idTabHrefShort">{l s='Extra tab' mod='productcomments'}</a></li> {/if} Also let me know what template file you are trying to edit. 1 Link to comment Share on other sites More sharing options...
sebkos Posted February 22, 2012 Share Posted February 22, 2012 ...or find Product Cms module which do the same but you can easily manage displayed content. Link to comment Share on other sites More sharing options...
charlie123 Posted February 22, 2012 Author Share Posted February 22, 2012 you could try {if $product->id_category_default==3} <li><a href="#msTabHolder" class="idTabHrefShort">{l s='Extra tab' mod='productcomments'}</a></li> {/if} Also let me know what template file you are trying to edit. Thank you, your solution seems to works perfect. Can I also ask how I can add multiple categories ID's please? For example if I want to display content under category 3 and 5 and 6 instead of only 3? Thank you for your help! Link to comment Share on other sites More sharing options...
bellini13 Posted February 22, 2012 Share Posted February 22, 2012 you could do this... {if $product->id_category_default==3 or $product->id_category_default==5 or $product->id_category_default==6} 1 Link to comment Share on other sites More sharing options...
charlie123 Posted February 22, 2012 Author Share Posted February 22, 2012 you could do this... {if $product->id_category_default==3 or $product->id_category_default==5 or $product->id_category_default==6} Thanks! Works well. Marking as solved. 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