Jump to content

[SOLVED] How to create a global variable in prestashop ?


avi_24

Recommended Posts

Hai friends how to create a global variable in prestashop which we can use across all admin/front controllers............actually i want to store a value to a variable from a particular controller and use it from other controllers..... can anyone suggest a solution...(i dont want to use configuration variable...as i want to use this particular variable as session based)

Link to comment
Share on other sites

Avi, as you can see inAdminProductsController, they already use exactly that pice of code to get the ID, for example here:

 

in function: public function processUpdate()
 
they have this line of code:
 
$preview_url .= 'adtoken='.$this->token.'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id;
 
So, if I understand your question correctly, you can just directly use it here, as given.
 
Please elaborate if I misunderstood.
 
pascal
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...