prestashop

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

How to fix the Defer parsing of JavaScript in prestashop?

核能气质少年 提交于 2019-12-12 03:53:44
问题 I have tested my website on gtmetrix.com. It shows me the following error: 717.8KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering To solve this error , I have found the following solution from google: 1.Use the async attribute : When I use the async attribute in script .It works fine in google chrome but it does not work in other browser ex : {foreach $javascript.external as $js} <script async type="text/javascript" src="{$js

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

Product::getProductsProperties(): 'id_image' returns 'en_default', not image

倖福魔咒の 提交于 2019-12-12 02:45:29
问题 I've build a module to make a custom page with some products. I've tried to //get all products $products_partial = Product::getProducts($this->context->language->id, 0, 1000, 'name', 'asc'); $products = Product::getProductsProperties($this->context->language->id, $products_partial); foreach ($products as $product) { //here comes some logic to select some products (not relevant for this question) //echo the image ID $results[] = $product; } $this->context->smarty->assign(array( 'products' =>

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 - insert products script

有些话、适合烂在心里 提交于 2019-12-12 00:27:19
问题 I am looking for sql or php script which shows how to insert integrated data represents product with its attributes, images etc. to PrestaShop database. Does anyone know steps of this process - I mean name of tables and columns I need to fill. 回答1: Read the source!! You have access to every classes, so just take a look at Product.php and ObjectModel.php and you will have every infos you need about the fields and the tables. If your goal is to insert products, you don't need to write any sql

Add order web service

穿精又带淫゛_ 提交于 2019-12-12 00:23:33
问题 I developed a Prestashop web service for a mobile application. I can connect a user, create user accounts, create cart but I do not manage to create orders. I have the following error: HTTP XML response is not parsable: array ( 0 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 9, 'column' => 64, 'message' => 'Input is not proper UTF-8, indicate encoding ! Bytes: 0x95 0x08 0x77 0xE2 ', 'file' => '', 'line' => 778, )), 1 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 9,

redirect old product links to new prestashop product links

流过昼夜 提交于 2019-12-11 23:24:29
问题 I have transferred a old webshop to prestashop. The products have the same ID´s. The old link look like this: /shopexd.asp?id=2760&bc=no And the new one like this. /da/mover/2760-truma-mover-sr.html Is it possible to redirect to the new product links? By modifying the .htaccess file ? 回答1: I assume you are using apache as webserver. Try something like that and add: RewriteRule ^shopexd.asp?id=([0-9]+)&(.*)$ /product.php?id_product=$1 [QSA,L] to your .htaccess file. 回答2: This works if you

Update product from a module in prestashop

て烟熏妆下的殇ゞ 提交于 2019-12-11 20:36:47
问题 I have to update the price and quantity values of specific products in a database. As I understand, simply executing sql commands is not a great option since there are a lot of tables which have similar informations. I have read that Product() object should be created. How should I create the Product object and then update it in the database? 回答1: You can check the class ProductCore in classes/Product.php for various methods and properties Generally, you would write some code like this /