prestashop

How to fix error “Fatal error: Uncaught --> Smarty: unable to write file”?

萝らか妹 提交于 2020-01-03 19:40:54
问题 I migrated Prestashop from localhost to website domain using digitalocean, but when I open this website I get this error Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/prestashop/cache/smarty/compile/a4/36/f1/wrt549a35e49b3b44_77591243 <-- thrown in /var/www/html/prestashop/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46. I tried to change permissions on the smarty folder to 755, but it didn't work. I don't know how to fix it. 回答1: You problem is

How to fix error “Fatal error: Uncaught --> Smarty: unable to write file”?

痴心易碎 提交于 2020-01-03 19:40:33
问题 I migrated Prestashop from localhost to website domain using digitalocean, but when I open this website I get this error Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/prestashop/cache/smarty/compile/a4/36/f1/wrt549a35e49b3b44_77591243 <-- thrown in /var/www/html/prestashop/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46. I tried to change permissions on the smarty folder to 755, but it didn't work. I don't know how to fix it. 回答1: You problem is

Where does Prestashop Logger::addLog() save the log file?

蓝咒 提交于 2020-01-03 09:02:35
问题 I came across the following line in a Prestashop module: Logger::addLog('2: md5 string is '.$md5HashData, 1); Where is the log saved? 回答1: The log is saved in database in 'log' table (with your current prefix); You can find the addLogg function from classes/Logger.php However there is no documentation you can find something useful from method comment /** * add a log item to the database and send a mail if configured for this $severity * * @param string $message the log message * @param int

How does prestashop loads Images?

人走茶凉 提交于 2020-01-03 01:42:51
问题 I have 2 prestashop stores hosted in the same ftp with the same products one of them have all the images loaded (Over 9k) and the other has none, I want to know from what controller and function does prestashop loads the images. I know the images are stored inside /img/p {digits with slashes}/product_id.jpg so the only thing I'm missing is the place where the images are loaded in the front end so I can alter that function and make it point to the photos of the other shop in order to avoid the

PrestaShop: Delete all testing data before production

微笑、不失礼 提交于 2020-01-02 05:39:06
问题 I'm searching a script to run on MySql to delete (truncate table) all the testing data (customer, order,cart, etc) on a PrestaShop database version 1.4.9. Thank Pascal 回答1: Install the Prestashop Cleaner and in configure you have options to delete catalog, orders and customers 回答2: For 1.5.6.2 (probably works for 1.5.6*, even maybe for 1.5.*) : TRUNCATE `ps_access`; TRUNCATE `ps_address`; TRUNCATE `ps_alias`; TRUNCATE `ps_attribute`; TRUNCATE `ps_attribute_group`; TRUNCATE `ps_attribute_group

Make an ajax request from a Prestashop module

吃可爱长大的小学妹 提交于 2020-01-01 00:48:13
问题 I am making a module and I need to make an ajax request, with JSON response if possible, how can i do this ? I don't understand really well the structure of Prestashop 1.7 on this. Thanks ! 回答1: This is pretty simple, you just have to make the controller with Prestashop's standards then link it to your frontend Javascript. Name a php file like this : ./modules/modulename/controllers/front/ajax.php Then put inside : <?php // Edit name and class according to your files, keep camelcase for class

Prestashop - how do I write to a log file?

依然范特西╮ 提交于 2019-12-31 03:02:13
问题 What php code should I use in a Prestashop module to write to a log file? I have used Logger::addLog("something",1); but it does not work. 回答1: You can also store the log in file using below code. $logger = new FileLogger(0); //0 == debug level, logDebug() won’t work without this. $logger->setFilename(_PS_ROOT_DIR_.”/log/debug.log”); $logger->logDebug(“message 1″); $logger->logDebug(“message 2″); It will work!. Thanks 回答2: The log is saved in database in 'log' table (with your current prefix)

'Home' category page not working after update

非 Y 不嫁゛ 提交于 2019-12-31 02:54:05
问题 A prestashop website at version 1.4.1.4 was working with category.php file for category pages. The update to 1.6.0.6 unfortunatley deleted that file because it has been considered as deprecated. (URL structure changed after CMS update) One consequence is the change in the URL structure. from: url/category.php?id_category=6 to : url/index.php?id_category=6&controller=category&id_lang=2 So now, the first URL structure is giving 404. The question: We don't know why all the category pages are

Invalid configuration file

倾然丶 夕夏残阳落幕 提交于 2019-12-25 18:38:40
问题 I wanna install this theme theme but I get "Invalid configuration file" 回答1: Prestashop themes for import/autoinstallation should be packed by another way, zip file must contain: themes/your-theme-folder/ and Config.xml file where described which modules have to be enabled/disbaled etc. In your case solution is: Unpack zip into shop /themes/ folder. In backoffice Preferences -> Themes at the bottom Create new theme , set theme name and name of folder that was unpacked from zip in your case

PrestaShop: Translating overrided controller

梦想的初衷 提交于 2019-12-25 18:02:25
问题 I've created a module that overrides an AdminProductController.php and make a new bulk_action. <?php class AdminProductsController extends AdminProductsControllerCore { public function __construct() { parent::__construct(); $this->bulk_actions['setprice'] = array( 'text' => $this->l('Set a price for selected'), 'icon' => 'icon-price', ); } } Now I need to translate the action text and distribute that translation with module. The problem is that I don't see the original text inside modules