Ahmed Ibrahim Posted January 25, 2023 Share Posted January 25, 2023 Quote public function initFormByDrivers() { $this->fields_form = array( 'legend' => array( 'title' => $this->l('By Drivers'), 'icon' => 'icon-calendar' ), 'input' => array( array( 'type' => 'select', 'lang' => true, 'name' => 'id_employee', 'col' => '8', 'label' => $this->l('Drivers'), 'required' => true, 'options' => array( 'query' => Employee::getDriverEmployees(true), 'id' => 'id_employee', 'name'=> 'full_name', ) ), ), ); $this->table = 'driver'; $this->show_toolbar = true; $this->show_form_cancel_button = true; return parent::renderForm(); } option => id => id_employee echo Tools::getValue('id_employee');die(); when print id_employee in postProcess not retrieve value why? Link to comment Share on other sites More sharing options...
razaro Posted January 25, 2023 Share Posted January 25, 2023 Well you have to debug it like we all do. Start to back track and check what Employee::getDriverEmployees(true) function returns [id_employee, full_name]. And check documentation more https://devdocs.prestashop-project.org/8/development/components/helpers/helperform/#select 1 Link to comment Share on other sites More sharing options...
Ahmed Ibrahim Posted January 25, 2023 Author Share Posted January 25, 2023 thank you for reply but mr razor i want to send id_driver when print pdf invoice i'll send you screen first i selected driver employee second when i select one of status and make generate pdf i want send id_driver who shipped this order and print it in pdf Link to comment Share on other sites More sharing options...
razaro Posted January 25, 2023 Share Posted January 25, 2023 Hmm well not sure without taking a look at other code but maybe this is happening. You have that top custom form without Generate pdf button, and it is separate form. But you click on bottom Generate button that is just "By order status" and that form do not have "By Drivers" field information. So you can not retrieve id_employee just like that. You could try to add submit button there, and like other two forms later in code do a check if that button is pressed and execute command which will involve id_employee. 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