kingsinnersoul Posted June 29, 2013 Share Posted June 29, 2013 Hello, I have a button which the user can change its state. I wish to be able to store the button's state for the user's session in a cookie (I guess its the best method?). I really have no experience with this issue but I have read several posts here in the forums but they all talk about 1.4 and earlier. I do understand that PS 1.5 has introduced the context and it replaced the way the code should be. Can anyone share with me a code example of how can I create a variable in the cookie and set/access it? Is the access done fromt he tpl file or from the php file? (the button is in product-list.tpl) Thank you Link to comment Share on other sites More sharing options...
vekia Posted June 29, 2013 Share Posted June 29, 2013 use context object: $this->context->cookie you can display all cookies with: print_r($this->context->cookie); Link to comment Share on other sites More sharing options...
taoufiqaitali Posted March 13, 2014 Share Posted March 13, 2014 $cookie->__set('cookiename' , $cookiedata); Link to comment Share on other sites More sharing options...
gautamkakadiya Posted December 17, 2014 Share Posted December 17, 2014 Hello Everyone, I have define the cookie in javascript file using document.cookie variable. the javascript file is store in my custom module. i have override OrderConfirmation controller into my module. now i want to access the javascript cookie into my override controller. i fetch cookie using $this->context->cookie variable but it is not working. please give me any idea or solution how i access cookie... Thank you very much in advance Link to comment Share on other sites More sharing options...
tijojoel Posted January 15, 2018 Share Posted January 15, 2018 In cookie array how do I access [cookie] => Cookie Object ( [_content:protected] => Array ( [date_add] => 2017-11-24 12:06:16 [id_lang] => 1 [detect_language] => 1 [id_employee] => 1 => [email protected] [profile] => 1 [passwd] => 8d2f564977b1eea3356236ee2a2addbe [remote_addr] => 2130706433 [shopContext] => s-1 [LastCheck] => 1512016103 [submitFiltertab] => 0 [multicolor_fee] => [submitFilterproduct] => 0 [submitFilterorder] => 1 [ordersorderFilter_pog!id_organization] => 3 [ordersorderFilter_a!date_add] => a:2:{i:0;s:0:"";i:1;s:0:"";} [checksum] => 3592475459 ) 1. ordersorderFilter_pog!id_organization 2. ordersorderFilter_a!date_add this filters? 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