Hi,
I want to add translation support for my field in configure area in module and services section.
I am using prestashop version 1.6.x and I made change as per other modules and below documentation link.
http://doc.prestashop.com/display/PS16/Making+your+module+work+with+Bootstrap
I am able to see field and multiple languages translation drop down option as per attach image.
But after saving field data not getting saved. It shows empty fields.
Below is my code.
PrestaShop Tutorials Videos [How to do Tasks]
public function renderForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->l('Settings'), 'icon' => 'icon-cogs' ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Block Title'), 'name' => 'BLOCK_TITLE', 'lang' => true, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Slide show time interval.'), 'name' => 'TIME_INTERVAL', 'hint' => $this->l('Only integer values allowed:'), 'desc' => $this->l('The interval in milli seconds example 8000.Only integer values allowed.'), 'lang' => true, 'required' => true ) ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'btn btn-default pull-right' ) ), ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; $helper->identifier = $this->identifier; $helper->submit_action = 'submitStoreConf'; $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); return $helper->generateForm(array($fields_form)); } public function getConfigFieldsValues() { $languages = Language::getLanguages(false); $fields = array(); foreach ($languages as $lang) { $fields['BLOCK_TITLE'][$lang['id_lang']] = Tools::getValue('BLOCK_TITLE'.$lang['id_lang'], Configuration::get('BLOCK_TITLE', $lang['id_lang'])); $fields['TIME_INTERVAL'][$lang['id_lang']] = Tools::getValue('TIME_INTERVAL'.$lang['id_lang'], Configuration::get('TIME_INTERVAL', $lang['id_lang'])); } return $fields; }
Any idea to solve this problem.