If you have any issues installing this module, we will be happy to provide assistance for free.
Unzip the folder
Unzip your module file (WHMCS Module - Affiliates land anywhere.zip) and move the folder named "WHMCS Module - Affiliates land anywhere" to your desktop.
Setup your custom landing pages
Open the following file using a code/text editor (NotePad++ on Windows, TextEdit on Mac):
Desktop/WHMCS Module - Affiliates land anywhere/upload/aff-urls.php
In this file you can define all of your custom landing pages, you can add an unlimited number of landing pages both inside or outside of WHMCS. When a affiliate clicks on your link it'll redirect them to the WHMCS aff.php file as normal to record the visit/set the affiliate cookie and then redirect to the landing page set in the URL.
First set your default URL below, we recommend using your websites homepage but you could also use your WHMCS cart or the most important page on your website.
$defaultURL = "http://www.yourwebsite.com/";
Replace the URL between the double quotes with your homepage e.g:
$defaultURL = "http://www.myhostingcompany.com/";
Next you can set your custom landing pages, we've added some examples for you:
$urls['domains'] = "http://www.yourwebsite.com/clients/domainchecker.php";
$urls['web-hosting'] = "http://www.yourwebsite.com/web-hosting.php";
$urls['about-us'] = "http://www.yourwebsite.com/about/";
The default affiliate link uses the following format:
http://www.yourwebsite.com/aff.php?aff=000
Using the affiliates land anywhere module affiliates can add the landing page on the end as follows:
http://www.yourwebsite.com/aff.php?aff=000&page=domains
As you can see we are defining each URL using a separate link, the page variable on the left and the landing page URL on the right. Let's add a new URL, for example you have a SSL page at http://www.yourwebsite.com/ssl-certificates.php, you can add the following in aff-urls.php:
$urls['ssl'] = "http://www.yourwebsite.com/ssl-certificates.php";
You can now offer the following URL to your affiliates:
http://www.yourwebsite.com/aff.php?aff=000&page=ssl
Upload files
Once you've finished editing the aff-urls.php file with your default and custom landing pages you'll need to upload the module to your WHMCS.
Open up FileZilla and login to your web hosting account as normal. On the left side (your local computer’s files) navigate to the upload folder as seen above. On the right side (your web hosting account) navigate to inside the WHMCS folder as seen above. Select all of the files from the left side, then upload. Both the server and local side will contain the aff.php file, this will be overwritten in WHMCS, the aff-urls.php is a unique file of the module so it won't be overwritten.
Provide the URLs to your affiliates
Now your custom landing URLs are active and ready to use it's now time to provide them to your affiliates to benefit from.
A great way to display your affiliate resources is using the Affiliate Links box in your WHMCS admin panel under setup > general settings > affiliates > Affiliate Links.
Anything you add to this box will display to your affiliates on the affiliates.php page of WHMCS. We can also add the affiliate ID option to the resources so the affiliate will see their exact affiliate link and be able to copy/paste it to their website without editing.
Below is example code you can use in the affiliate links box which uses the examples in the aff-urls.php file, you'll need to edit this to add your links.
<p>You can use the following URLs to direct your visitors to a specific page on our website:</p>
<p>Domains - <a href="[AffiliateLinkCode]&page=domains" target="_blank">Demo</a>: <input value="[AffiliateLinkCode]&page=domains" type="text" readonly="readonly" class="form-control" /></p>
<p>Web Hosting - <a href="[AffiliateLinkCode]&page=web-hosting" target="_blank">Demo</a>: <input value="[AffiliateLinkCode]&page=web-hosting" type="text" readonly="readonly" class="form-control" /></p>
<p>About Us - <a href="[AffiliateLinkCode]&page=about-us" target="_blank">Demo</a>: <input value="[AffiliateLinkCode]&page=about-us" type="text" readonly="readonly" class="form-control" /></p>
<p>If you'd like to send your visitors to another page on our website <a href="contact.php">send us an email</a> and we will create the link for you.</p>
To install copy/paste the above code to setup > general settings > affiliates > Affiliate Links then edit the URLs to those you have set for your affiliates.
Provide the URLs to your affiliates (multi-lang)
If you would like your link integration to support multi-languages you can use the following code sample:
<p>{$LANG.affiliateslandanywhere_p1}</p>
<p>{$LANG.affiliateslandanywhere_l1} - <a href="{$referrallink}&page=domains" target="_blank">{$LANG.affiliateslandanywhere_demo}</a>: <input value="{$referrallink}&page=domains" type="text" readonly="readonly" class="form-control" /></p>
<p>{$LANG.affiliateslandanywhere_l2} - <a href="{$referrallink}&page=web-hosting" target="_blank">{$LANG.affiliateslandanywhere_demo}</a>: <input value="{$referrallink}&page=web-hosting" type="text" readonly="readonly" class="form-control" /></p>
<p>{$LANG.affiliateslandanywhere_l3} - <a href="{$referrallink}&page=about-us" target="_blank">{$LANG.affiliateslandanywhere_demo}</a>: <input value="{$referrallink}&page=about-us" type="text" readonly="readonly" class="form-control" /></p>
<p>{$LANG.affiliateslandanywhere_p2}</p>
This code needs to be added directly to your activate templates affiliate.tpl file:
/whmcs_path/templates/your_template/affiliates.tpl
If this file doesn't exist then copy it from the parent theme (twenty-one or six).
Within affiliates.tpl replace the following code with the above code:
{if $affiliatelinkscode}
<h2>{lang key='affiliateslinktous'}</h2>
<div class="margin-bottom text-center">
{$affiliatelinkscode}
</div>
{/if}
Next add the following to each of the languages you wish to support and translate as needed:
$_LANG['affiliateslandanywhere_p1'] = "You can use the following URLs to direct your visitors to a specific page on our website:";
$_LANG['affiliateslandanywhere_demo'] = "Demo";
$_LANG['affiliateslandanywhere_l1'] = "Domains";
$_LANG['affiliateslandanywhere_l2'] = "Web Hosting";
$_LANG['affiliateslandanywhere_l2'] = "About Us";
$_LANG['affiliateslandanywhere_p2'] = "If you'd like to send your visitors to another page on our website <a href=\"contact.php\">send us an email</a> and we will create the link for you.";
For example to support English add this code to:
/whmcs_path/lang/english.php
To support French add this code to:
/whmcs_path/lang/french.php
Comments
If you have any questions please leave a comment below or contact our support.