Joey Posted May 30, 2019 Share Posted May 30, 2019 Hi, I want to get two unique session id which is using to identify the customer from Clickwise - Affiliate Marketing When the visitor reach our landing page, the identifier is included. e.g. https://www.domain.com/?refid=4f99af95c9aaa&clickid=tPogaaa ‘refid’ is the click identifier. The value represents which affiliate it is from. $_SESSION[‘affid'] = '4f99af95c9aaa’; $_SESSION[‘clickid’] = 'tPogaaa'; So I need store two session id when they visit our page. How can I add this two session ID and store it in prestashop 1.7 I will pass this two session id in order confirmation page, it mean this two ID must still value when customer confirm the order. eg: http://track.clickwise.net/pb?AccountId=00e01aaa&CampaignID=58460177&ActionCode=sale&OrderID= 0000001&TotalCost=100&Currency=HKD&RefId=4f99af95c9aaa&ExtraData=tPogaaa Link to comment Share on other sites More sharing options...
tdsoft Posted May 30, 2019 Share Posted May 30, 2019 Prestashop does not allow use $_SESSION, you can use cookie for store your ID $this->context->cookie->affid = '4f99af95c9aaa'; $this->context->cookie->clickid = 'tPogaaa'; Link to comment Share on other sites More sharing options...
Joey Posted May 30, 2019 Author Share Posted May 30, 2019 Which files I should amend to add this code? Thanks and this two value can last on order confirmation page? Link to comment Share on other sites More sharing options...
Joey Posted June 6, 2019 Author Share Posted June 6, 2019 (edited) Hi! I can store the cookie using following command successfully $cookie=&$this->context->cookie; $cookie->__set(íd', 'AAA'); echo $cookie->__get('íd'); However, I want set this cookie value expiry time to browser close, not want to change the cookie global time in admin -> preference -> default is 240 hours I tried $cookie->setExpire(0); but it will show below error, seem setExpire cannot overload the global cookie. So what command can only set this value to expired when browser closed? in Cookie.php line 142 at ErrorHandler->handleError('8', 'Indirect modification of overloaded property Cookie::$_context has no effect', '/home/cyeshop/classes/Cookie.php', '142', array('expire' => '0')) in Cookie.php line 142 at CookieCore->setExpire('0') in IndexController.php line 44 at IndexControllerCore->initContent() in Controller.php line 205 at ControllerCore->run() in Dispatcher.php line 428 at DispatcherCore->dispatch() in index.php line 28 $cookie->__set(íd', 'AAA'); However, I want set this cookie value expiry time to browser close, not want to change the cookie global time in admin -> preference -> default is 240 hours I tried $cookie->setExpire(0); but it will show below error, seem setExpire cannot overload the global cookie. So what command can only set this value to expired when browser closed? in Cookie.php line 142 at ErrorHandler->handleError('8', 'Indirect modification of overloaded property Cookie::$_context has no effect', '/home/cyeshop/classes/Cookie.php', '142', array('expire' => '0')) in Cookie.php line 142 at CookieCore->setExpire('0') in IndexController.php line 44 at IndexControllerCore->initContent() in Controller.php line 205 at ControllerCore->run() in Dispatcher.php line 428 at DispatcherCore->dispatch() in index.php line 28 Edited June 6, 2019 by Joey (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now