Search the Community
Showing results for tags 'descrption'.
-
Hello friends, this is my plugin I wanted the word test in all products to be updated by clicking the save button in the product description Note: The code must be such that we do not get 500 errors in the number of products above I apologize for writing And be multilingual public function getContent() { /** * If values have been submitted in the form, process. */ if (((bool)Tools::isSubmit('submitDynamicdescriptionModule')) == true) { $this->postProcess(); } $this->context->smarty->assign('module_dir', $this->_path); $output = $this->context->smarty->fetch($this->local_path.'views/templates/admin/configure.tpl'); return $output.$this->renderForm(); } /** * Create the form that will be displayed in the configuration of your module. */ protected function renderForm() { $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $helper->module = $this; $helper->default_form_language = $this->context->language->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0); $helper->identifier = $this->identifier; $helper->submit_action = 'submitDynamicdescriptionModule'; $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->getConfigFormValues(), /* Add values for your inputs */ 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id, ); return $helper->generateForm(array($this->getConfigForm())); } /** * Create the structure of your form. */ protected function getConfigForm() { return array( 'form' => array( 'legend' => array( 'title' => $this->l('Settings'), 'icon' => 'icon-cogs', ), 'input' => array( array( 'type' => 'switch', 'label' => $this->l('Live mode'), 'name' => 'DYNAMICDESCRIPTION_LIVE_MODE', 'is_bool' => true, 'desc' => $this->l('Use this module in live mode'), 'values' => array( array( 'id' => 'active_on', 'value' => true, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => false, 'label' => $this->l('Disabled') ) ), ), ), 'submit' => array( 'title' => $this->l('Save'), ), ), ); } /** * Set values for the inputs. */ protected function getConfigFormValues() { return array( 'DYNAMICDESCRIPTION_LIVE_MODE' => Configuration::get('DYNAMICDESCRIPTION_LIVE_MODE', true), ); } /** * Save form data. */ protected function postProcess() { $form_values = $this->getConfigFormValues(); foreach (array_keys($form_values) as $key) { Configuration::updateValue($key, Tools::getValue($key)); } } /** * Add the CSS & JavaScript files you want to be loaded in the BO. */ public function hookBackOfficeHeader() { if (Tools::getValue('module_name') == $this->name) { $this->context->controller->addJS($this->_path.'views/js/back.js'); $this->context->controller->addCSS($this->_path.'views/css/back.css'); } } public function hookActionProductUpdate($params) { $product = $params['object']; //$id_product = (isset($product['id_product']) ? $product['id_product'] : null); $id_product = 5; $product = new Product($id_product); if (((bool)Tools::isSubmit('submitDynamicdescriptionModule')) == true) { $description = $this->generateUniquedescription(null, $id_product); $this->setProductdescription($id_product, $description); } } protected function setProductdescription($id_product, $description) { $description = trim($description); if ( $id_product > 0) { Db::getInstance()->execute( 'UPDATE `' . _DB_PREFIX_ . 'product_lang` SET `description` = "' . pSQL($description) . '" WHERE `id_product` = ' . (int)$id_product ); return true; } return true; } public function generateUniquedescription($text_product) { $text_product = 'test'; return $text_product; } Thank
-
Módulo de Productos en la misma Categoría
VeronicaH posted a topic in Módulos y plantillas gratuitas
Buenas tardes. He activado el módulo "Productos en la misma categoría" y "Productos vistos recientemente", pero tengo un error con ellos, el primer producto de la lista aparece correctamente, pero los demás aparecen sin la sección product-description, en la cual aparece el nombre, el precio y el botón add-to-cart. Código en el inspector del primer producto: Código en el inspector del segundo producto: Si me pueden ayudar a definir en que archivo .tpl está el error o bien, que es lo que está pasando se los agradecería mucho, Saludos. -
Hi, i would like to show description of second (Random, different) category description at the bottom of the current category page. Thnakyou
-
Bonjour, J'ai remarqué un problème bizarre depuis quelques temps: sur certaines pages produits, la fin de la description_short s'affiche tout en haut de ma page en front-office. J'ai essayé de raccourcir la description (dans les paramètres, j'autorise 1000 caractères et il y en a moins dans la description), En mode debug, aucune erreur ne s'affiche. Voir une des pages Merci de votre aide, Bonne journée Marilyne