prestashop

Prestashop 1.6 Create Module to Display Carrier Filter

自作多情 提交于 2019-12-06 12:31:45
问题 My Prestashop-based site is currently having an override for AdminOrdersController.php, I have placed it in override folder. From the link provided below, it is perfectly working fine to add a Carrier filter which is not available in Prestashop 1.6 now. I have tried the solution and it is working perfectly. Reference: Adding carrier filter in Orders page. Unfortunately, for production site, I have no access to core files and unable to implement as such. Thus, I will need to create a custom

Prestashop: Out of Memory (allocated …) in ../../../classes/Configuration.php

谁说我不能喝 提交于 2019-12-06 12:31:04
Prestashop suddenly gives an http 500 error . I turned on error log and got this: "Fatal error: Out of memory (allocated 709623808) (tried to allocate 130968 bytes) in /var/www/vhosts/44/252639/webspace/httpdocs/shop.mywebsite.com/classes/Configuration.php on line 206". I double checked the Configuration.php on line 206 and it's just a standard prestashop file, nothing weird in it. After all it's an "Out of memory" error so maybe I should increase memory. phpinfo() shows memory_limit 1024M , which is already pretty much, but maybe I should try 2048M. I tried to create a new custom php.ini but

How to clear all produts from cart in PrestaShop

对着背影说爱祢 提交于 2019-12-06 11:42:00
问题 I am using PrestaShop version 1.5.4.1 Currently, my cart has separate delete buttons for each product. How can I remove all the products in one action? I just need to empty the cart in one click. I have used this code in ordercontroller and call the function from themes/defaulte/shoopin-cart.tpl public function emptybag() { $products = $this->getProducts(); foreach ($products as $product) { $this->deleteProduct($product->id); } } 回答1: Many things : $this->getProducts() won't work in the order

Prestashop 1.6 custom module not displaying up on front end

て烟熏妆下的殇ゞ 提交于 2019-12-06 11:20:15
问题 My module is not displaying on the frontend , I was following this link doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module to create a custom module in prestashop 1.6.I've checked the position , cleared and disabled the cache , uninstalled and reinstalled the module but nothing worked so far . p.s the config.xml was generated automatically. here is my mymodule.php code <?php if (!defined('_PS_VERSION_')) exit; class MyModule extends Module { public function __construct() { $this-

How to change content of order confirmation email template in prestashop?

天大地大妈咪最大 提交于 2019-12-06 09:29:07
问题 I want to change the content of order confirmation email template, only if a particular product has ordered. Is there any solution? 回答1: You can find the general template of email order confirmation in mails/language/order_conf.(html/txt). The product list template in mails/languages/order_conf_product_list.(tpl/txt) Called in classes/PaymentModule.php, validateOrder() function if you want to add variables. 来源: https://stackoverflow.com/questions/32367989/how-to-change-content-of-order

Prestashop: How to get accessories for product

此生再无相见时 提交于 2019-12-06 07:39:23
how can I get accessories for each product? In a loop: {foreach $products as $product} // get accessories {/foreach} The problem is that the module HomeFeatured doesn't retrieve accessories for products so they aren't available in the template. You have the choices : edit the PHP code of the module : simple but not upgrade proof duplicate the module to myhomefeatured : easy too but less, and upgrade proof I prefer the 2nd, more future proof & you can add more and more logic after if you need. Whatever you choose, here the modified code of hookDisplayHome to ahve a Smarty variable $accessories

Prestashop root directory

懵懂的女人 提交于 2019-12-06 07:26:08
I am working with prestashop and in the theme I have added my own directory with a stylesheet inside it I have then linked the stylesheet in header.tpl eg <link rel="stylesheet" type="text/css" href="/directory/style.css" /> however If i install prestashop in a subdirectory eg www.website.com/prestashop/ then the style is not showing because it thinks the root of the site is www.website.com. is there a pretsashop string I can use to echo the directory prestashop is installed in? eg something like $ps_dir or $ps_uri ??? So I can do something like this <link rel="stylesheet" type="text/css" href

Updating order status in Prestashop via webservice api

青春壹個敷衍的年華 提交于 2019-12-06 06:39:32
What am I doing wrong here? First I make a request to get an existing order and I change the value of current_status field in retrieved xml. Then I make a PUT request with modified xml as a parameter but I get something like this in response: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[127]]></code> <message><![CDATA[XML error : String could not be parsed as XML XML length : 2864 Original XML : xml=%3C%3Fxml+version%3D%221%2E0%22+encoding...%3C%2Fprestashop%3E%0A]]></message> </error> </errors> </prestashop>

Prestashop shipping cost by state

痞子三分冷 提交于 2019-12-06 05:00:13
Is there by any chance a way to set shipping cost by state in a carrier in prestashop? i.e. let's say i want a different shipping cost to send in Alabama than in Alaska with the same carrier Thanks Mike Kranzler There are a couple ways of doing this. You can purchase an external module, such as this one , or create an override like so : 1) Copy "classes/Address.php" to "override/classes/Address.php". 2) In line 28 change class name from AddressCore to Address 3) Before function getZoneById, paste this new function /** * Return postcode of address * * @param $id_address Address id * @return

Where to register global smarty modifier in PrestaShop?

安稳与你 提交于 2019-12-06 02:49:42
I'm creating a store based on PrestaShop (v 1.6), and I want to register my custom modifier plugin to be accessible from any templates (includinf front and back-officetemplates). The question is where to place the registration code? Now I use a Tools class override to add function to handle modifier (that is acceptable practice in case of store-specific functionality, afaik), and smarty.config.inc.php to register plugin (because all PrestaShop plugins are registereg here), but this file contains a warning about "not to modify file directly" and, as far as I understand, will be overwritten when