Post by acidrs » Tue Jan 31, 2017 2:58 am

Hello,
I had a look in the marketplace to see if there anything even close to this and couldn't find anything. To be honest i am not even sure if its possible.
I am wanting to see if it is possible that when a customer uses an affiliate link to visit the store that the affiliates name could be displayed in header or top navigation bar. Something like Welcome, your are shopping with "affiliate name"

If this is possible i am wanting to expand on the idea to add an image upload section to the affiliate account page as a kind of profile picture. That picture would also be displayed in the Header or somewhere at the top of the store page along with the welcome message.

I am using Opencart version 2.3.0.2

Any help with this is greatly appreciated.

New member

Posts

Joined
Tue Oct 06, 2015 11:00 am

Post by acidrs » Thu Feb 02, 2017 12:28 am

Ok so i have been doing some research on this and found that this can be done 1 of 2 ways.
The first is checking the cookie
<?php
if(isset($_COOKIE['tracking'])){
echo "<div>I can tell you've been here before</div>";
} else {
setcookie('tracking', true, 5184000 + time()); //hold fo 2 months
echo "<div>Its your first time being here</div>";
}
?>

This will check for the affiliate tracking cookie and display a message based on if the cookie is present or not.

The second way is to use Url Parameters
There is a nice article http://jennamolby.com/how-to-display-dy ... arameters/ that gives a nice example.

The cookie path seems to be a better option based on the fact that the cookies stays in the browser till it expires. So if the customer uses the tracking link the cookie is saved. Then when they return not using the tracking link it will still use the affiliate tracking as long as the cookie hasnt expired.
Url parameters requires that the user always use the tracking link.

New member

Posts

Joined
Tue Oct 06, 2015 11:00 am
Who is online

Users browsing this forum: No registered users and 5 guests