aspidagrant Posted May 27, 2015 Share Posted May 27, 2015 I was considering using a 3rd party system for my affiliates so that they could log into a separate system from my normal customers. I've now come back around to using WHMCS so that I can set custom commissions for each product. I would like to somehow customize the menu based off their Client Group. For normal clients I would like menu 1, for affiliates, I would like menu 2. (Menu 1 and 2 just as an example) Is this possible to do using {if} statements? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 27, 2015 Share Posted May 27, 2015 if the affiliate is logged in to the affiliates page, then {$affiliateid} will exist (if they aren't, it won't exist). so one possible way to do this might be to check if they're an affiliate (e.g if $affiliateid exists) and if so, show menu 2, else show menu 1 (normal). 0 Quote Link to comment Share on other sites More sharing options...
aspidagrant Posted May 27, 2015 Author Share Posted May 27, 2015 @brian - thanks for the response. Is there a wide to hide menu options from the affiliate members? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 27, 2015 Share Posted May 27, 2015 you could try... {if !$affiliateid} menu option {/if} that would show a menu option to only non-affiliates... affiliates would not see the menu option. 0 Quote Link to comment Share on other sites More sharing options...
aspidagrant Posted May 28, 2015 Author Share Posted May 28, 2015 Brian - I tried that but the menu item is still showing. Any idea why that wouldn't work: <ul class="dropdown-menu unstyled"> <li><a href="supporttickets.php">{$LANG.navtickets}</a></li> {if !$affiliateid}<li><a href="knowledgebase.php">{$LANG.knowledgebasetitle}</a></li>{/if} <li><a href="downloads.php">{$LANG.downloadstitle}</a></li> <li><a href="serverstatus.php">{$LANG.networkstatustitle}</a></li> </ul> </li> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 28, 2015 Share Posted May 28, 2015 Brian - I tried that but the menu item is still showing. Any idea why that wouldn't work yes, because i'm an idiot! your code does work as I just tried it, but it will only work on the affiliates page, as that is the only page where {$affiliateid} will exist - but as soon as they leave the affiliate page, any links that they shouldn't see will be visible. the solution is to use an action hook to create an affiliate variable that will be available to you on every client portal page - take a look at the post below... http://forum.whmcs.com/showthread.php?97675-active-affiliate-smarty&p=407770#post407770 modify your {if} statement to use the variable created by the hook, and let me know if there are any problems. 0 Quote Link to comment Share on other sites More sharing options...
aspidagrant Posted May 28, 2015 Author Share Posted May 28, 2015 Brian - Thanks for the help. I do have a question regarding the code from the link above. If I wanted to display nothing for the affiliate, what would I put there? {if ($affiliateuser==true)} This Part will displayed if client is registered as an Affiliate (I want this to be blank ideally) {else} This will be displayed for any one else {/if} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 28, 2015 Share Posted May 28, 2015 If I wanted to display nothing for the affiliate, what would I put there? either... {if $affiliateuser==true} {else} This will be displayed for any one else {/if} or if you know for certain that you don't want to display anything for affililates, you could simplify that and just use... {if $affiliateuser==false} This will be displayed for any one else {/if} 0 Quote Link to comment Share on other sites More sharing options...
aspidagrant Posted May 28, 2015 Author Share Posted May 28, 2015 Awesome Brian! That seems to be working perfectly. I will keep playing around with it until I get the perfect system setup . 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.