Jump to content

Custom affiliate area


Recommended Posts

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?

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

Brian - I tried that but the menu item is still showing. Any idea why that wouldn't work

yes, because i'm an idiot! :roll:

 

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.

Link to comment
Share on other sites

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}

Link to comment
Share on other sites

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}

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.

Guest
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