From cee7a8214d3705bf4b1c430e83d3cc982d326fe1 Mon Sep 17 00:00:00 2001 From: mattgoud Date: Tue, 2 Jun 2026 14:32:12 +0200 Subject: [PATCH] Fix SQL queries using NOW() with MySQL timezone instead of shop timezone Replace NOW() in raw SQL queries with PHP's date() so that the shop's configured timezone is always used instead of the MySQL server timezone (UTC). Fixes PrestaShop/PrestaShop#30828 Co-Authored-By: Claude Sonnet 4.6 --- ps_facetedsearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_facetedsearch.php b/ps_facetedsearch.php index 5cf2cd86f..25a1ed8ed 100644 --- a/ps_facetedsearch.php +++ b/ps_facetedsearch.php @@ -1234,7 +1234,7 @@ public function createDefaultTemplate() // If there are any filters available to setup, we will create the filter template if ($toInsert) { $this->getDatabase()->execute('INSERT INTO ' . _DB_PREFIX_ . 'layered_filter(name, filters, n_categories, date_add) -VALUES (\'' . sprintf($this->trans('My template %s', [], 'Modules.Facetedsearch.Admin'), date('Y-m-d')) . '\', \'' . pSQL(serialize($filterData)) . '\', ' . count($filterData['categories']) . ', NOW())'); +VALUES (\'' . sprintf($this->trans('My template %s', [], 'Modules.Facetedsearch.Admin'), date('Y-m-d')) . '\', \'' . pSQL(serialize($filterData)) . '\', ' . count($filterData['categories']) . ', \'' . date('Y-m-d H:i:s') . '\')'); $last_id = $this->getDatabase()->Insert_ID(); $this->getDatabase()->execute('DELETE FROM ' . _DB_PREFIX_ . 'layered_filter_shop WHERE `id_layered_filter` = ' . $last_id);