ton Posted February 12, 2014 Share Posted February 12, 2014 I have developed a module for Prestashop 1.5 which used HelperForm. However, HelperForm is not available in PrestaShop 1.4. What should I use so that it is compatible both Prestashop 1.4 and 1.5? Thanks in Advance. Link to comment Share on other sites More sharing options...
NemoPS Posted February 12, 2014 Share Posted February 12, 2014 You can use an if statement to check the current PS_VERSION, and include your own library of helperform (that you create, or clone from 1.5) to use in that case Or, always using the if statement, hardcode what you used the helper form for Link to comment Share on other sites More sharing options...
Pedro Lima Posted August 10, 2016 Share Posted August 10, 2016 Have you ever made this working? I have the very same situation as you and I am not being able to implement this. Can you help a little bit by explaining what you have done? Thanks a lot. Link to comment Share on other sites More sharing options...
NemoPS Posted August 13, 2016 Share Posted August 13, 2016 if (version_compare(_PS_VERSION_, '1.5', '<') { // the 1.4 part} else {// the helper form} Link to comment Share on other sites More sharing options...
Pedro Lima Posted August 13, 2016 Share Posted August 13, 2016 if (version_compare(_PS_VERSION_, '1.5', '<') { // the 1.4 part } else { // the helper form } I appreciate your help and that's the very easy part. The hard part is figuring out how to make it work. I mean, I've tried to import HelperForm.php from 1.5 and other files as well but I couldn't make it work so I suppose there are other ways of doing it in 1.4 which are totally different from 1.5 and 1.6. This is my helperform by the way, how could I convert this to 1.4? $helper = new HelperForm(); $helper->show_toolbar = true; // false -> remove toolbar $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. $helper->toolbar_btn = array( 'save' => array( 'desc' => $this->l('Save'), 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name. '&token='.Tools::getAdminTokenLite('AdminModules'), ), 'back' => array( 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list') ) ); $helper->table = $this->table; $helper->name_controller = $this->name; $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->override_folder = '/'; $helper->module = $this; $helper->submit_action = 'submitRemarketingEmailsSms'; $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_1, $fields_form_2, $fields_form_3, $fields_form_4, $fields_form_5, $fields_form_6, $fields_form_7, $fields_form_8, $fields_form_9, $fields_form_10, $fields_form_11, $fields_form_12, $fields_form_13 )); Thanks a lot in advance. Link to comment Share on other sites More sharing options...
NemoPS Posted August 15, 2016 Share Posted August 15, 2016 Ah, you can't. You have to build the form manually in 1.4, otherwise you have to invent you own. That's how it used to work, manually writing each div and element 1 Link to comment Share on other sites More sharing options...
vekia Posted August 15, 2016 Share Posted August 15, 2016 prestashop 1.4 does not have any kind of helper 1 Link to comment Share on other sites More sharing options...
Pedro Lima Posted August 15, 2016 Share Posted August 15, 2016 Ah, you can't. You have to build the form manually in 1.4, otherwise you have to invent you own. That's how it used to work, manually writing each div and element prestashop 1.4 does not have any kind of helper Thank you both for your inputs. Ok, so that means a lot of work and I will probably simply put this uncompatible with v1.4 1.4 market isn't that big, right? Link to comment Share on other sites More sharing options...
NemoPS Posted August 17, 2016 Share Posted August 17, 2016 It's small and decreasing Link to comment Share on other sites More sharing options...
Pedro Lima Posted August 17, 2016 Share Posted August 17, 2016 It's small and decreasing Thanks a lot for your answer. I don't know if this is true or not, but WOW! https://w3techs.com/technologies/details/cm-prestashop/1/all Link to comment Share on other sites More sharing options...
NemoPS Posted August 17, 2016 Share Posted August 17, 2016 Can't confirm, 70% of my customers use 1.6, another 28% uses 1.5, and just a couple used 1.4 and are migrating anyway Link to comment Share on other sites More sharing options...
Pedro Lima Posted August 17, 2016 Share Posted August 17, 2016 Can't confirm, 70% of my customers use 1.6, another 28% uses 1.5, and just a couple used 1.4 and are migrating anyway Thanks a lot for your input. I really appreciate it. Link to comment Share on other sites More sharing options...
Recommended Posts