Page 1 of 1

Affiliate Issue in Opencart

Posted: Fri Apr 17, 2015 6:39 am
by ashaw25
Hello. I have an Affiliate module active on my site (came with the installation). I sell bath/body/candle products and I have a lady that wants to refer people to my site using an affiliate link so they can purchase and she receives commission. However, it looks like how this module works though, is that she has to generate an affiliate link per PRODUCT instead of an affiliate link that takes them to the home page and lets them shop amongst various categories giving her credit for all of the products they buy. Does anyone know of another module that will do that?

Thank you very much in advance!

Re: Affiliate Issue in Opencart

Posted: Tue Apr 21, 2015 4:26 am
by ocmta
You can easily add the homepage link with tracking to any affiliate template like this:
  • In openCart 1:

    Code: Select all

    <?php echo HTTPS_SERVER . '?tracking=' . $this->affiliate->getCode(); ?>
  • In openCart 2:

    Code: Select all

    <?php echo HTTPS_SERVER . '?tracking=' . $this->registry->get('affiliate')->getCode(); ?>
Also, when the link points to a product page, that does not mean affiliate will not be credited for purchases of other products.

When users access any openCart page with tracking links, tracking code is saved in cookies for 1000 days and will be used in all their orders of any products, even a year later (unless they clear their cookies).

Re: Affiliate Issue in Opencart

Posted: Mon Apr 27, 2015 10:03 am
by 4andilyn
Where exactly (what file) would this line of code need to be entered?

Re: Affiliate Issue in Opencart

Posted: Mon Apr 27, 2015 1:08 pm
by ocmta
In catalog/view/theme/<your_theme_name>/template/affiliate/ - account.tpl and / or tracking.tpl

Re: Affiliate Issue in Opencart

Posted: Mon Apr 27, 2015 7:54 pm
by 4andilyn
I'm using Open Cart 2.0.2.0 so do I just put this line of code anywhere on those files?

In openCart 2:
<?php echo HTTPS_SERVER . '?tracking=' . $this->registry->get('affiliate')->getCode(); ?>

Re: Affiliate Issue in Opencart

Posted: Mon Apr 27, 2015 8:02 pm
by ocmta
Those files are html templates with some php for dynamic data, so you should put this code where you want it appear, not just anywhere. This code will display the homepage URL with tracking code, where / how to use it in html - that's up to you.