prestashop

Override Prestashop Module Changes not Visible

青春壹個敷衍的年華 提交于 2019-12-25 11:52:03
问题 I am attempting to override a module in Prestashop but the changes are just not appearing. I have overridden a template file and a controller so I have added the following files: \override\modules\blockwishlist\views\templates\front\mywishlist.tpl \override\modules\blockwishlist\controllers\front\mywishlist.php These are very simple changes where I add another column to a table that contains a button. When the button is clicked the controller generates a CSV file. Any idea why these changes

Prestashop : How to Empty cart?

我是研究僧i 提交于 2019-12-25 06:52:05
问题 I want to make Cart order list empty after a new product has been added to the cart. In fact only on product every time can be in cart. Tanx 回答1: 2 ways to add your custom logic : create your own module and hook it on "actionCartSave" override "add" and "update" methods in "Cart" class (/override/classes/Cartp.php) Edit : The 2nd way os wrong because infinite update loop. Here is a module that do it : class OneProductCart extends Module { public function __construct() { $this->name =

Prestashop 1.6 Webservice Order

 ̄綄美尐妖づ 提交于 2019-12-25 05:21:11
问题 I'm trying to finish my custom module to import clients, addresses, carts and orders from a webservice. Clients, Adresses and Carts imports works fine but when trying to insert new Order, it returns this error: This call to PrestaShop Web Services failed and returned an HTTP status of 500. That means: Internal Server Error. If i take a look to my apache2 error.log I can see this error: PHP Fatal error: Call to a member function validateOrder() on boolean in /var/www/html/prestashop_pool

Prestashop set multiple select from the module and get them in the input

大兔子大兔子 提交于 2019-12-25 04:53:15
问题 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

Prestashop add a token to ajax file

◇◆丶佛笑我妖孽 提交于 2019-12-25 04:26:11
问题 I tried sending to my module prestashop addons. I got a message "Technical validation has been declined". This message contain the You need to add a token to your ajax file. My ajax script is: $.ajax({ type: "post", url : "../modules/priceupdate/ajax-call.php", data: "ajax=ps_ajax_update_prices", success : function(response){ $('#update-ajaxresponse').html(response) } }); Regards 回答1: Usually the token are declared by PrestaShop, you should to add only the token in your data : $.ajax({ type:

How to override prestashop core files

☆樱花仙子☆ 提交于 2019-12-25 01:49:36
问题 Can you please explain how to override following core files properly in presatashop. Prestashop 1.7.1.2 allowed only controllers, modal and tpl files in override folder. We can not override src folders in same way. src/PrestaShopBundle/Controller/Admin/ProductController.php src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig 回答1: I don't believe this is possible in Prestashop 1.7. See their post here : it seems like they want you to use hooks, ie extending not overriding... 回答2:

Top ad banner Prestashop 1.7.1

孤街浪徒 提交于 2019-12-25 00:51:25
问题 I would like to understand how this top banner (SALE 70% OFF ALL PRODUCTS) included in this image can be done: https://medias2.prestastore.com/906398-pbig/banner-manager.jpg Is it needed an extra module for that? If so, which one? If not, how can you modify the theme to include it? 回答1: This is Banner Block (blocbanner in files) module, included by default, that you can manage in your backoffice. 来源: https://stackoverflow.com/questions/47274748/top-ad-banner-prestashop-1-7-1

Ecommerce plugin development - how to periodically check the platform DB and call external API

时光怂恿深爱的人放手 提交于 2019-12-24 22:00:04
问题 I'm developing a module for Prestashop and I'll make a premise valid for Prestashop development environment: a module/plugin can do it's work thanks to some hooks, like Header, or leftBar, or BackOffice header loading, so apparently there is no way to do what I want to do: I want to periodically (let's say each day) check for abandoned cart in Prestashop database and send their information to external API. I thought of a workaround which I don't like very much and it doesn't seem efficient to

Get module version in Prestashop

半城伤御伤魂 提交于 2019-12-24 21:15:06
问题 I have a module installed on my Prestashop and I want to get its version How can I do this in my code ? Let's say for example I want to get "v5.0.1" Thanks for the help ! 回答1: $module = Module::getInstanceByName('bienvenue'); $version = $module->version; 回答2: The version is set in the module file like that: public function __construct() { $this->name = 'bienvenue'; $this->version = '5.0.1'; parent::__construct(); /* Else code... */ } 来源: https://stackoverflow.com/questions/52273359/get-module

Products default sort not working on search.tpl - Prestashop 1.6.0.6

纵然是瞬间 提交于 2019-12-24 21:08:25
问题 I set up in backoffice the default sort type to : in stock. this works for all pages except SearchController template file : search.tpl. What can be the causes behind such dysfunctionning? I really don't know what part of code to deal with. Thanks everyone who already met such issue for advices. Edit: I discovered that the link in the adress bar after click on search button is: website/index.phpcontroller=search&orderby=position&orderway=desc&search_query=design+40&submit_search=Rechercher