Search the Community
Showing results for tags 'context context-employee'.
Found 1 result
How to store variables (several forms in same page)
Sono_fre posted a topic in Core developersHi all, i'm new and i'm developing a plugin for prestashop, and i have some problems on understanding the prestashop workflow. I have added several forms in the plugin and all are intercepted by postProcess method, and this is ok. What i'm trying to do is to save the values "somewhere" so even after different calls of different forms, the values of olds submitted forms are still retrievable. I'm currently trying to use $this->context->employee to save values but without any luck. I'll give you an example just to make sure what i would like to achieve: I have 2 forms Select Day form with input field day Select month form with input field month Select day |_______| |_SUBMIT_| Select month |_______| |_SUBMIT_| I insert day and submit it, catch the value in the postProcess and save it somewhere, (now i do $this->context->employee->selected_day = Tools::getValue('dayinputfield'); $this->context->employee->update(); ) Now i insert the month and i press submit but the value $this->context->employee->selected_day is now longer avaible...is null What i'm missing? What is the best practice in cases like this? Thanks for the answers!