Jump to content

Re-direct based on affiliate ID?


Recommended Posts

I was told that this can be done, but I haven't figured it out and was hoping to get some help from the community. Thank you in advance for your time.

 

What I am trying to accomplish is :

 

Summary

I have several associations that want to sign up with our affiliate plan so they can advertise a preferred hosting rate for their members.

 

I know how to setup affiliates in the system, as well as additional pages. I would like to setup a Cart page for each affiliate so I can customize it specifically for them so when they refer their members, their member's see the Associations logo and company brand colors etc..

 

Technical Help Needed

Once I create the additional Cart page, how do I redirect the affiliate to specific page I created based on their affiliate ID?

 

Thank you again for your time. I am a novice programmer at best, but am a quick study - any help would be hugely appreciated.

 

Best regards,

Charles

Link to comment
Share on other sites

best bet would be to not create new pages, but add conditionals in the display of the cart.

 

For example, if you want to display association1.jpg image for affiliate id 100, and association2.jpg image for affiliate id 200. You'd do something like this in the template file:

 

{if $smarty.cookies.WHMCSAffiliateID eq '100'}
 <img src="images/association1.jpg" />
{elseif $smarty.cookies.WHMCSAffiliateID eq '200'}
 <img src="images/association2.jpg" />
{else}
 <!-- Display no image for other affiliates or non-affiliates. -->
{/if}

Link to comment
Share on other sites

Frank:

 

Light bulb moment - would I just add this code where I want the image to show up?

 

Thats correct. You'd modify the templates where you want to display custom information, and add the conditional where you want it to display. The variable assumes that someone went to your site using the "http://www.yoursite.com/*?aff=111" URL link for affiliates. This sets a cookie on their machine to track the affiliate.

Link to comment
Share on other sites

best bet would be to not create new pages, but add conditionals in the display of the cart.

 

For example, if you want to display association1.jpg image for affiliate id 100, and association2.jpg image for affiliate id 200. You'd do something like this in the template file:

 

{if $smarty.cookies.WHMCSAffiliateID eq '100'}
 <img src="images/association1.jpg" />
{elseif $smarty.cookies.WHMCSAffiliateID eq '200'}
 <img src="images/association2.jpg" />
{else}
 <!-- Display no image for other affiliates or non-affiliates. -->
{/if}

 

Great job, that code will definitely come in handy some time.

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