Answer the question
In order to leave comments, you need to log in
Why doesn't PrestaShop show the module config panel correctly?
Why does Presta show my module config ugly, not like other modules?
This is how my module is shown:
This is how others:
The module was made according to the official PrestaShop 1.7 guide.
This is the code responsible for rendering the form
public function displayForm()
{
// Get default language
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
// Init Fields form array
$fields_form[0]['form'] = array(
'legend' => array(
'title' => 'Настройки',
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'text',
'label' => 'ID',
'name' => 'WIDGET_ID',
'required' => true
)
),
'submit' => array(
'title' => 'Сохранить',
)
);
$helper = new HelperForm();
// Module, token and currentIndex
$helper->module = $this;
$helper->name_controller = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
// Language
$helper->default_form_language = $default_lang;
$helper->allow_employee_form_lang = $default_lang;
// Title and toolbar
$helper->title = $this->displayName;
$helper->show_toolbar = true; // false -> remove toolbar
$helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen.
$helper->submit_action = 'submit' . $this->name;
$helper->toolbar_btn = array(
'save' => array(
'desc' => 'Сохранить',
'href' => AdminController::$currentIndex . '&configure=' . $this->name . '&save' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules')
),
'back' => array(
'href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'),
'desc' => 'Вернуться к списку'
)
);
// Load current value
$helper->fields_value['WIDGET_ID'] = Configuration::get('WIDGET_ID');
return $helper->generateForm($fields_form);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question