PrestaShop Admin Auto Log Out

After migrating a PrestaShop site to a new server, logging in to the admin area shows the dashboard, and when I click any link, I get redirected to the login page. Initially, I suspended the problem due to the PHP session not working properly, to verify, I created a file with the following content.

PrestaShop clean MySQL database tables

On a PrestaShop site, queries like the following get stuck forever SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer, “-” as page FROM `ps_connections` c INNER JOIN `ps_guest` g ON c.id_guest = g.id_guest WHERE (g.id_customer IS NULL OR g.id_customer = 0) AND c.id_shop IN (1) AND TIME_TO_SEC(TIMEDIFF(‘2022-08-14 21:31:00’, c.`date_add`)) < 900 AND c.ip_address NOT IN (1522500673,858191475) ORDER BY ... Read more

PrestaShop Enable Memcached

Enable memcached in PrestaShop

You need to install the memcached daemon and PHP module on the server before you can configure it in PrestaSop. You can find instructions for doing this in Install memcached on CentOS 7 Enable memcached on Magento 2 in Plesk Server How to Install memcached on CentOS Plesk Server Once you have Memcached installed, you … Read more

PrestaShop show order comment in PDF invoice

PrestaShop order comment in invoice

To show user comment in PrestaShop PDF invoice Edit file classes/pdf/HTMLTemplateInvoice.php vi classes/pdf/HTMLTemplateInvoice.php Inside function getContent(), find around line 161 $carrier = new Carrier((int) $this->order->id_carrier); Add below $sokOrderComment = $this->order->getFirstMessage(); In the same file, around line 333, find the $array variable, inside it, add ‘sokOrderComment’ => $sokOrderComment, Edit file pdf/invoice.tpl vi pdf/invoice.tpl Find {$legal_free_text|escape:’html’:’UTF-8’|nl2br} Add … Read more

PrestaShop show total product weight in PDF invoice

Show weight in prestashop invoice

To show total product weight in PrestaShop PDF invoice, edit file. vi classes/pdf/HTMLTemplateInvoice.php Inside function getContent(), on line 166, find foreach ($order_details as $id => &$order_detail) { Replace with $sokTotalWeight = 0; foreach ($order_details as $id => &$order_detail) { $sokTotalWeight += $order_detail[“product_weight”] * $order_detail[“product_quantity”]; On around line 332, find $data = array( ‘order’ => $this->order, … Read more

PrestaShop add customer email to invoice

PrestaShop show customer email

PrestaShop PDF invoice won’t show customer email address by default for some strange reason. To show the email address in the Invoice, we need to manually modify PrestaShop files. This instruction is tested on PrestaShop version 1.7.6.7. To show customer email address in PrestaShop PDF invoice, edit file vi classes/pdf/HTMLTemplateInvoice.php On line 329, find $data … Read more

PrestaShop Error Declaration of Cart::getPackageShippingCost

On a PrestaShop site, i get error message (1/1) ContextErrorException Warning: Declaration of Cart::getPackageShippingCost($id_carrier = NULL, $use_tax = true, ?Country $default_country = NULL, $product_list = NULL, $id_zone = NULL) should be compatible with CartCore::getPackageShippingCost($id_carrier = NULL, $use_tax = true, ?Country $default_country = NULL, $product_list = NULL, $id_zone = NULL, bool $keepOrderPrices = false) in Cart.php … Read more

Nginx upstream sent too big header

Plesk Nginx

When I log in to a PrestaShop website, I get an error on a Plesk server. 502 Bad Gateway On checking error login for the site in folder /var/www/vhosts/domain.com/logs/proxy_error_log, I found the following error message proxy_error_log:2020/11/25 19:41:41 [error] 1809#0: *39664 upstream sent too big header while reading response header from upstream, client: 59.92.71.53, server: tulivesi.com, … Read more

Enable SSL in PrestaShop 1.7

To enable SSL in PrestaShop 1.7, go to Admin > Shop Parameters > General On this page, you need to set YES for Enable SSL. After saving, you can enable “Enable SSL on all pages”. Using phpMyAdmin/MySQL You can run following SQL query to enable SSL. select * from ps_configuration where name=”PS_SSL_ENABLED”; select * from … Read more

PrestaShop Product Images not showing

PrestaShop SEO URL configuration

After migrating a PrestaShop 1.7 web site to another domain, site did not show product images. To fix this, you need to regenerate .htaccess by disabling and enabling “Friendly URL”. Login to PrestaShop Admin area, go to CONFIGURE > Shop Parameters > Traffic & SEO On this page, scroll down to “Set up URLs” section. … Read more