prestashop-1.6

Prestashop custom admin module draggable sort/order not working

匆匆过客 提交于 2019-12-12 14:30:14
问题 I'm building a very simple module for Prestashop 1.6 and I added an admin interface that allows to list my records, a form to add and edit and delete. This is working fine as you can see here: The problem is that draggable reorder button is not draggable. Hence the reordering is not working... According to the official docs, if you set the position option in your controller, you get the draggable functionality: ['position'] => 'position', // If set to position, the field will display arrows

Prestashop - change product category in database

北城以北 提交于 2019-12-12 05:53:50
问题 I need to mass change product categories. I updated two tables in database: ps_category_product (changed old id_category) and ps_products (changed old id_category_default) but in BO product table and webshop I still see old category (home). When I edit product, select tab associations I see that product is associated with my new caterogy. Only when I save the product by click save button I see that product in properly categories. I compared two rows in database (product with changed category

prestashop multiple checkboxes do not save values

断了今生、忘了曾经 提交于 2019-12-12 05:36:31
问题 I can't figure out why the checkbox values are not saved in the database using helpers. Trying to save some customers ids from my module's setting : The array : $custs = Customer::getCustomers(); foreach ($custs as $key => $value) { $options[] = array( 'id_customer' => (int)$value['id_customer'], 'infos' => $value['firstname'].' '.$value['lastname'].' | '.$value['email'] ); } The checkboxes : 'input' => array( array( 'type' => 'checkbox', 'label' => $this->l('Customers'), 'desc' => $this->l(

Filter employees by profile_id in back office Employees tab

喜夏-厌秋 提交于 2019-12-12 04:54:54
问题 i try to apply a filter by profile on my tab "employees" in back-office, just need to list the employees with profile_id = 6. I found this part of code in AdminEmployeesController.php, line 175 to 184 : public function renderList() { $this->_select = 'pl.`name` AS profile '; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile` LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = ' .(int)$this->context->language-

PrestaShop Validator: SQL security issues

岁酱吖の 提交于 2019-12-12 04:32:31
问题 Good evening, I'm validating PrestaShop on my form. The mistake is reflected: Your module contains security issues. - Make sure that your data is always protected when doing an insertion. For instance, make sure that you do have an integer with an explicit (int) cast, and that text is protected against SQL injections thanks to the pSQL() method. - Be careful (string) is not a secured cast, you must pSQL. The insert query I use are as follows: Db::getInstance()->execute('INSERT IGNORE INTO '.

Prestashop: not saving field

空扰寡人 提交于 2019-12-12 04:13:34
问题 I'm working in a Prestashop 1.6 module and I'm having problem with one field that seems not to be recognized. In the controller I'm using the renderForm() method to get the form and I define the field in the form like this: array( 'type' => 'text', 'label' => $this->l('Message'), 'name' => 'message', 'required' => true, 'hint' => $this->l('Message to be shown when the customer exceeds the quota '), ), And in the model class I define it like this: 'message' => array( 'type' => self::TYPE

Product autocomplete input on module (Prestashop)

穿精又带淫゛_ 提交于 2019-12-12 02:58:50
问题 I'm developing a prestashop module that has to make lists of existing products. For the configuration panel of the module, using renderForm() and getContent() , I'm trying to replicate the "accesories" capability, where you start writing some info of a product on an input, and it shows the products that are a match. When selecting that product, it gets added on a list. Like this: This a screenshot of Catalog / Products / Associations tab. I'm trying with PS 1.6.0.14 and PS1.6.1.0RC3. How

How to add admin menu entry for a specific module on Prestashop1.6?

此生再无相见时 提交于 2019-12-12 01:57:22
问题 In a Prestashop 1.6 store, how can I add a new admin/backoffice menu entry for an existing/installed module (for example, bankwire or blocktopmenu modules)? 回答1: If you try to add the item menu in "Administration" -> "Menus" with the class of the module and the name, probably you get an error that says that it's impossible to find the controller. Then you need to create this controller in the module. You need to create a file in /moudles/[name-of-the-module]/controllers/admin/ with the name

Prestashop product update hook is not updating product attributes in the hook function

别等时光非礼了梦想. 提交于 2019-12-11 10:14:23
问题 I am using hookActionProductUpdate . I am getting all data updated but not attributes. This is the code inside hook function: public function hookActionProductUpdate($params) { $prestaObject = new ProductCore($params['id_product'], false, Context::getContext()->language->id); $arrrs = $prestaObject->getFrontFeatures(1); } Everything else is updated but the front features I am getting are the older one. Any IDEA? EDIT : I tried this too, here is my new function: public function

Prestashop 1.6 gamification module always adding and editing files

百般思念 提交于 2019-12-11 04:42:56
问题 I am developing a custom Prestashop 1.6 module. I added all the website to git in order to track my changes. I created the .gitignore file using gitignore.io. The problem is there are always new added files and changed files in the gamification module. Should I add the gamification module folder to .gitignore or there is another solution? 回答1: Here is the content of my .gitignore file: # Created by .ignore support plugin (hsz.mobi) ### Prestashop template # Private files # The following files