N@D33M Posted February 28, 2014 Share Posted February 28, 2014 (edited) Hi, I would like to add an external variable in employee context array, how to add additional variable in employee array? Let's say I wanted to add something like this: $context->employee['accessVerified'] = true; so later I could access that variable somewhere in admin like: if($context->employee->accessVerified) ... Please help. Thanks, Edited February 28, 2014 by N@D33M (see edit history) Link to comment Share on other sites More sharing options...
N@D33M Posted February 28, 2014 Author Share Posted February 28, 2014 Can anyone please reply back to my question? Link to comment Share on other sites More sharing options...
elvizgz Posted March 19, 2014 Share Posted March 19, 2014 (edited) Hello! Maybe it's a little bit late but have you tried doing the following: $this->context->employee->accessVerified = true; I've tried this in the front and I think it works. Edited March 19, 2014 by elvizgz (see edit history) Link to comment Share on other sites More sharing options...
elvizgz Posted March 19, 2014 Share Posted March 19, 2014 I double checked and my previous answer it's wrong. You should use this: $this->context->cookie->accessVerified = true; I'm not completely sure if it'll work but you can try it. Link to comment Share on other sites More sharing options...
vekia Posted March 20, 2014 Share Posted March 20, 2014 when employe will log out, this variable will be still defined Link to comment Share on other sites More sharing options...
elvizgz Posted March 20, 2014 Share Posted March 20, 2014 So in the logout, just unset it: unset($this->context->cookie->accessVerified) or $this->context->cookie->accessVerified = false Maybe there is a better way to do it. I'm quite newbie un Prestashop Link to comment Share on other sites More sharing options...
Recommended Posts