Page 1 of 1

[SOLVED] How can I always include an affiliate?

Posted: Tue Nov 20, 2018 9:22 am
by SamNabz
Hey all,

Looking for a way to include a specific affiliate in all orders so that they always get a commission, regardless of whether the customer used their referral link or not (which won't be used anywhere anyway).

What would be the best way to achieve this? Any help is appreciated.

Thanks in advance :)

Re: How can I always include an affiliate?

Posted: Wed Nov 21, 2018 9:36 am
by IP_CAM
they always get a commission, regardless of whether the customer used their referral link or not
Well, how in the World should it be possible for OC, to know, which one of the Affiliates
gets the commission, if there is no way, to identify the affiliate, related to this... :crazy:

Better think twice! ;)
Ernie

Re: How can I always include an affiliate?

Posted: Wed Nov 21, 2018 10:17 am
by SamNabz
Hey IP_CAM, thanks for the response.

There will only be 1x affiliate account in the system. So is there no way for me to include the affiliate's tracking ID on all orders during the checkout process?

Re: How can I always include an affiliate?

Posted: Wed Nov 21, 2018 10:28 am
by ocmta
I really doubt that it should be built into openCart and i guess this is a wrong forum for a question like that, you probably should post it in a proper support forum.
On a practical level, if you just need that in your store, you could hardcode affiliate's tracking code somewhere, but implementation depends on your openCart version.

Re: How can I always include an affiliate?

Posted: Wed Nov 21, 2018 10:53 am
by SamNabz
Hey ocmta,

Sorry, I must have posted this into the wrong section of the forum. I don't want this to be built into OC, it's more so a customization I'm looking to implement for a particular site I'm working on. Admins, please move this to the right forum (if applicable).

Hardcoding this customization is fine. I'm using OC version is 3.0.2.0 - any ideas?

Re: How can I always include an affiliate?

Posted: Wed Nov 21, 2018 11:07 am
by ocmta
Edit file catalog/controller/startup/startup.php, find:

Code: Select all

public function index() {
and put these 2 lines below:

Code: Select all

if (isset($this->request->get['tracking'])) unset($this->request->get['tracking']);
if (!isset($this->request->cookie['tracking'])) setcookie('tracking', 'your_affiliate_tracking_code', time() + 3600 * 24 * 1000, '/');
(replace your_affiliate_tracking_code with actual tracking code of the affiliate)

Re: How can I always include an affiliate?

Posted: Wed Nov 21, 2018 11:22 am
by SamNabz
Hey ocmta,

Perfect, that worked!! Thanks for your help, much appreciated ;D