Post by Xellz » Tue Mar 13, 2012 12:45 am

Is there a relative simple solution for adding code to page not related to opencart? Why i want this, my opencart store is located in /shop and i would like to add ability to accept tracking code to home page.

Japanese green tea


New member

Posts

Joined
Fri Feb 11, 2011 8:55 pm

Post by ocmta » Tue Mar 13, 2012 5:47 am

Add ?tracking=<code> (or &tracking=<code> if the URL already contains ? ) to the page's URL, and the page itself should contain following PHP code:

Code: Select all

if (isset($_REQUEST['tracking']) && !isset($_COOKIE['tracking'])) setcookie('tracking', $_REQUEST['tracking'], time() + 3600 * 24 * 1000, '/');

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by Xellz » Wed Mar 14, 2012 3:01 am

ocmta wrote:Add ?tracking=<code> (or &tracking=<code> if the URL already contains ? ) to the page's URL, and the page itself should contain following PHP code:

Code: Select all

if (isset($_REQUEST['tracking']) && !isset($_COOKIE['tracking'])) setcookie('tracking', $_REQUEST['tracking'], time() + 3600 * 24 * 1000, '/');
Thanks a lot, really simple and works properly!

Japanese green tea


New member

Posts

Joined
Fri Feb 11, 2011 8:55 pm

Post by skimottaret » Thu Apr 12, 2012 7:39 pm

Xellz, we have the same desire to add tracking cookies to our home page and i would like to implement the solution on our home page as well. I looked at the source for your homepage and dont see the code as described, is this still working for you?

www.insideoutskiing.com home page

http://www.insideoutskiing.com/sales/in ... ommon/home opencart shop

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by skimottaret » Thu Apr 12, 2012 7:58 pm

thank you ocmta i am a non programmer so perhaps this solution is beyond my capability

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by alexismertens » Tue May 01, 2012 8:43 am

Hello,

It seems that this solution works only when the root domain name is the same as the domain name of the root of the domain of the opencart installation.

How to do this if it is another domain ? What to change in the script to create the cookie for the right domain ?

thank you

Newbie

Posts

Joined
Sat Mar 03, 2012 1:30 am

Post by skimottaret » Wed Sep 19, 2012 4:11 pm


New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm
Who is online

Users browsing this forum: Bing [Bot] and 10 guests