WHMCS affiliate URL Display Issues

Hello, I have set up an affiliate program in WHMCS however there is a small issue as I am using WHMCS WP Integration plugin it appears the URL of the affiliate link in WHMCS points to the WHMCS installation rather then the WP integrated version, is there anyway for WHMCS to display the WP encoded version for my clients.

Thanks for your help

  • Hoang Ngo
    • Code Slayer

    Hi there @Chris,

    I hope you are well today and I'm sorry about the issue.

    I've checked and the page returns from whmcs, so it comes with the affiliate link too, unfortunately, this means we can't change that link. :slight_frown:

    If you have any issues please don't hesitate to let us know so we can assist.

    Best regards,
    Hoang

  • Chris
    • Site Builder, Child of Zeus

    But if I was to change the link from for example,

    client.demo.domains/aff.php?=101

    To

    demo.domains/system/aff.php/?=101

    Or something like that would that still do the same thing so when some one purchases something after using a referral link the referrer still gets his/her commission, or if WHMCS redirects to the main site.

    Would any of the above possibilities work, if not are there any alternative plugins for the same functionality.

    thanks for your fantastic support :smiley:

  • Chris
    • Site Builder, Child of Zeus

    I don't know if I can change the link on the affiliate page but making client.demo.domains redirect to demo.domains, if I can change the link in WHMCS then I would as long as it worked so would it possibly work on those two scenarios :smiley:.

    Thanks for your help

  • Chris
    • Site Builder, Child of Zeus

    Hello I spoke with WHMCS who told me it was not possible, however I do have another idea, the WHMCS encoder, encodes the WHMCS based URL to a WordPress Supported URL, is it possible to create a index.php file or a .htaccess file so when someone uses a WHMCS URL it takes that URL encodes it and redirects to the newly encoded URL would that be simple to do :smiley: for example someone goes to client.demo.domains/aff.php?=101 which automatically gets encoded to demo.domains/whmcs/aff.php/?=101 or something and redirects to the later URL.

    Thanks for your fantastic support :smiley:

  • Jack Kitterhing
    • Code Norris

    Hi there @Chris,

    Hope you're well today and thanks for the additional information. :slight_smile:

    So your ID is to redirect client.demo (WHMCS link), to demo.domains, the only issue I see with that is, the encoder won't know the link, so we can do the redirect, but I believe the redirect will actually be to no where if that makes sense?

    We're here to help. :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • Chris
    • Site Builder, Child of Zeus

    sorry for the late reply, a index.php script takes the URL from the brosers address bar, then converts that the WPMUDEV encoded URL and redirects thanks for your help :smiley:

    I was wondering would it be possible to take the full URL given via the browser address bar and using most the code for encoding from the WHMCS integration code to encode it.

  • Chris
    • Site Builder, Child of Zeus

    Hello I have fixed the issue and thought I would explain how I fixed it here in case anyone else needs the information.

    To fix the issue simply go into the WHMCS template folder and open the affiliates.tpl file you should see a line

    <input type="text" size="60" value="{$referrallink}">

    add an ID to it so it looks like

    <input type="text" size="60" id="YOUR_ID" value="{$referrallink}">

    Then under that paste this code in

    {literal}
    <script>
    var link = document.getElementById("YOUR_ID").value;
    link = link.replace("YOUR_WHMCS_AFF_LINK", "YOUR_WORDPRESS_AFF_LINK");
    document.getElementById("YOUR_ID").value = link;
    </script>
    {/literal}

    replace YOUR_WHMCS_AFF_LINK and YOUR_WORDPRESS_AFF_LINK without the last numbers after the = sign.

    This should fix your problem be warned though if the template gets updated you may need to re-modify.

    Hope this helps all who need it.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.