Thomas-new Posted April 29, 2016 Share Posted April 29, 2016 (edited) Hi guys, I'm new on Prestashop and i am facing a problem. I want to add new tab in products back office and save data from form into a new tab.I display easily all things but now i fail to insert data from helper form into a new table that i created at the install of this module. Please help me ! Regards EDIT : public function hookdisplayAdminProductsExtra() { if (Validate::isLoadedObject($product = new Product((int) Tools::getValue('id_product')))) { return $this->renderForm().process(); } } function renderForm() { $guarantees = 'SELECT * FROM ' . _DB_PREFIX_ . 'guarantee'; $guarantees = Db::getInstance()->ExecuteS($guarantees); $guarantee_iteration = 0; foreach ($guarantees as $guarantee) { $guarantees[$guarantee_iteration]['nameselect'] = $guarantee['id_guarantee'] . ' - ' . $guarantee['name'] . ' - ' . $guarantee['type']; $guarantee_iteration++; } $fields_form_1 = array( 'form' => array( 'legend' => array( 'title' => 'Choix de la garantie produit', 'icon' => 'icon-cogs' ), 'input' => array( array( 'type' => 'select', 'name' => 'PS_GUARANTEE_SELECT', 'label' => 'Liste des garanties :', 'required' => true, 'hint' => 'Liste des garanties existante', 'options' => array( 'query' => $guarantees, 'name' => 'nameselect', 'id' => 'id_guarantee') ), ), 'submit' => array( 'title' => 'Enregistrer', 'class' => 'btn btn-default', 'name' => 'submitEditExtraTab' ) ) ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->name; $helper->module = $this; $helper->identifier = $this->identifier; $helper->submit_action = 'submitEditExtraTab'; $helper->currentIndex = $this->context->link->getAdminLink('AdminProducts', false); $helper->token = Tools::getAdminTokenLite('AdminProducts'); $helper->toolbar_btn = array( 'save' => array( 'short' => 'Sauv', 'desc' => 'Enregistrer' ), ); return $helper->generateForm(array($fields_form_1)); } public function process() { $id_product = (Tools::getValue('id_product')); //Some stuff if (Tools::isSubmit('submitEditExtraTab')) { //Here it's not working } } Edited April 29, 2016 by Thomas-new (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2016 Share Posted May 2, 2016 if you dump $_POST variable, do you see your submitEditExtraTab ? Link to comment Share on other sites More sharing options...
Thomas-new Posted May 3, 2016 Author Share Posted May 3, 2016 (edited) It's ok ! i just did a file .tpl to apply my view and the treatement in hookactionProductSave. Edited May 3, 2016 by Thomas-new (see edit history) 1 Link to comment Share on other sites More sharing options...
balko.online Posted October 20, 2016 Share Posted October 20, 2016 It's ok ! i just did a file .tpl to apply my view and the treatement in hookactionProductSave. Hi Thomas, it seems you found a solution to my current problem. Can you be more specific what "treatement in hookactionProductSave" mean? Thank you. 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