From 4c0b430bf8d994ab0d9ebbc0663a8d47e2dc41b2 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 --- classes/WishList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/WishList.php b/classes/WishList.php index 62aae242..4384ed91 100644 --- a/classes/WishList.php +++ b/classes/WishList.php @@ -525,7 +525,7 @@ public static function getByToken($token) public static function refreshWishList($id_wishlist) { $old_carts = Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->executeS(' - SELECT wp.id_product, wp.id_product_attribute, wpc.id_cart, UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(wpc.date_add) AS timecart + SELECT wp.id_product, wp.id_product_attribute, wpc.id_cart, ' . time() . ' - UNIX_TIMESTAMP(wpc.date_add) AS timecart FROM `' . _DB_PREFIX_ . 'wishlist_product_cart` wpc JOIN `' . _DB_PREFIX_ . 'wishlist_product` wp ON (wp.id_wishlist_product = wpc.id_wishlist_product) JOIN `' . _DB_PREFIX_ . 'cart` c ON (c.id_cart = wpc.id_cart)