Search the Community
Showing results for tags 'helperclass'.
-
I am doing a small module in Prestashop. In that module I have used multiselect with helperform. So my code is like this array( 'type' => 'select', 'cols' => 8, 'class' => 'chosen-product-selct selected_products ', 'multiple' => true, 'label' => $this->l('Selected Products'), 'name' => 'selected_products[]', 'options' => array( 'query' => $product_query, 'id' => 'id', 'name' => 'product_name' ), 'desc' => $this->l('Select products from products list.'), ), Here I am saving those multiselected values to the database. But when I am doing edit no saved values has been selected in the box. The box is totally empty. for getting the result I am doing this public function getConfigFieldsValues() { 'selected_products[]' => Tools::getValue('selected_products', Configuration::get('selected_products')), } Its not showing the values that has been entered.So can someone tell me how to solve this issue? Any help and suggestions will be really appreciable. Thanks
- 8 replies
-
- multiselect
- helperclass
-
(and 1 more)
Tagged with:
-
Hi, I just installed prestashop 1.6 on my localhost and tried to make a module. So in module I just used a form . So for craeting form I tried this code public function renderForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->l('My ModuleSettings'), 'icon' => 'icon-cogs' ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Site Url'), 'name' => 'YOUR_NAME', 'desc' => $this->l('Enter Your Name'), 'lang' => true, ), array( 'type' => 'select', 'lang' => true, 'label' => $this->l('Link Target'), 'name' => 'WEBSITE_LINK_TARGET', 'desc' => $this->l('Please Eneter Web Site URL Address.'), 'options' => array( 'query' => $options, 'id' => 'id_option', 'name' => 'name' ), $options = array( array( 'id_option' => 1, 'name' => 'Method 1' ), array( 'id_option' => 2, 'name' => 'Method 2' ), ) ), 'submit' => array( 'title' => $this->l('Save') ) ), ); $helper = new HelperForm(); $helper->show_toolbar = true; $helper->table = $this->table; $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->module = $this; $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 = 'submitmymoduleconf'; $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( 'uri' => $this->getPathUri(), 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); return $helper->generateForm(array($fields_form)); } But this code is not showing the select options input fields in the form. Whenever I am trying to load the page it is showing error like Undefined variable: options. I have gone through the documentation from this link http://doc.prestashop.com/display/PS16/Using+the+HelperForm+class but still can't able to solve this issue. So if someone kindly help me to solve this I will be really appreciable. Thanks.
- 5 replies
-
- module
- helperclass
-
(and 2 more)
Tagged with:
-
make query inside helper class and show options
prestashop_newuser posted a topic in Core developers
Hi, I am doing a small module in prestashop. In that module I want to show all the product category in the checkbox type. Lets say in the default prestashop installation(1.6) we have 3 main categories ( 1. Casual Dresses 2. Evening Dresses 3. Summer Dresses ) Now I want them in a tree manner with the checkboxes in a module backend( inside function renderForm() ). So can someone kindly tell me how to do this? How to make the query in side the renderFor(helper class) and show them as a checkbox? Any help and suggestions will be really appreciable. Thanks.- 1 reply
-
- helperclass
- renderform
-
(and 2 more)
Tagged with: