Jump to content

Conditional menu link based on product


Recommended Posts



I have a product. I also have a button in my client menu. When the client has the product I want the button to have a certain link. But when they don't have the product I want the button to have a different link.


I feel there should be a simple if statement I can use but I can't figure out the condition and I don't know how to access whether or not they have the product.


here is the code for the menu button:


<li{if $filename eq "analytics"} class="active"{/if}><a target="_blank" href="LINK GOES HERE"><span class="nav-affiliates">{$LANG.analyticsbutton}</span></a></li>


so basically, Where it says LINK GOES HERE, thats where 1 of 2 links will show depending on whether or not they have the analytics product.


Any help would be appreciated. Thank you.

Link to comment
Share on other sites



It depends on the page you are working on. You should {debug} it, find out where's the "status" parameter and then inject your Smarty code with something like:


<a href="{if $product.status eq 'Active'}active{else}buyme{/if}.php">Click me</a>



Hi, Thanks but the button is in the main menu so it needs to work on every page. I've checked using {debug} and there doesn't seem to be any parameter I can use. I guess I may be looking for an alternative way to do this or some code that might do the trick?

Link to comment
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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated