Jump to content

Xymor

Members
  • Posts

    9
  • Joined

  • Last visited

Contact Methods

Profile Information

  • Activity
    Freelancer

Xymor's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Reacting Well Rare
  • Dedicated Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

1

Reputation

  1. thanks, it still works in presta 8.1, just slightly updated: // Assemble the final number $formattedNumber = $majorDigits; if (in_array($minorDigits, array("0","00","000","0000","00000","000000"))) { //$formattedNumber = $formattedNumber; } else if (strlen($minorDigits)) { $formattedNumber .= self::DECIMAL_SEPARATOR_PLACEHOLDER . $minorDigits; }
  2. Thanks, it works on ps 8.1.2
  3. I don't recall where i had an error but i can post how my code looks now (it won't work with prestashop below 1.6) public function getContent() { if (Tools::isSubmit('submitSOME_MODULE')) { ... Configuration::updateValue('SOME_MODULE_TEXT_FIELD', Tools::getValue('SOME_MODULE_TEXT_FIELD'), true); ... } return $this->renderForm(); } in protected function renderForm() : array( 'type' => 'textarea', 'label' => $this->l('Text field content'), 'name' => 'SOME_MODULE_TEXT_FIELD', 'desc' => $this->l('Text field content.'), 'autoload_rte' => true, 'cols' => 50, 'rows' => 20, ), next: public function getConfigFieldsValues() { return array( .... 'SOMEMODULE_TEXT_FIELD' => Tools::getValue('SOMEMODULE__TEXT_FIELD', Configuration::get('SOMEMODULE__TEXT_FIELD')) ); } protected function postProcess() { $form_values = $this->getConfigFieldsValues(); foreach (array_keys($form_values) as $key) Configuration::updateValue($key, Tools::getValue($key)); }
  4. Hi, I cant save value of textarea public function getContent() { if (Tools::isSubmit('submitSomeModule')) { Configuration::updateValue('some_text', Tools::getValue('some_text'), true); } return $this->renderForm(); } protected function renderForm() array( 'type' => 'textarea', 'label' => $this->l('Text field content'), 'name' => 'some_text', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30, ), $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), /* Add values for your inputs */ 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id, ); public function getConfigFieldsValues() { return array( 'some_text' => Tools::getValue('some_text', Configuration::get('some_text')), ); } protected function postProcess() { $form_values = $this->getConfigFieldsValues(); foreach (array_keys($form_values) as $key) Configuration::updateValue($key, Tools::getValue($key)); }
  5. Hi. How to save the chosen categories in string with ID separated by comma?
  6. Hi. My module renders category tree using helper form ​'type' => 'categories'. How can i save selected ID in string separated by comma?
×
×
  • Create New...