dynamiclabs Posted December 8, 2014 Share Posted December 8, 2014 Hi, 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. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 8, 2014 Share Posted December 8, 2014 Hi 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> 0 Quote Link to comment Share on other sites More sharing options...
dynamiclabs Posted December 10, 2014 Author Share Posted December 10, 2014 Hi 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? 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted December 10, 2014 Share Posted December 10, 2014 You'll need to add some PHP to lookup whether they have the (active) product/service - have that return the 2 different links 0 Quote Link to comment Share on other sites More sharing options...
dynamiclabs Posted December 10, 2014 Author Share Posted December 10, 2014 You'll need to add some PHP to lookup whether they have the (active) product/service - have that return the 2 different links Thank you for that. Do you know how I would do that? Or have any examples of what it would look like. Thnaks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.