From a77111dc62e09f2441beedd7e4fecd9c07be4d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 4 Apr 2013 14:35:14 +0200 Subject: [PATCH] [-] Core: Cache of Cart::getPackageList is now per cart --- classes/Cart.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 1afc74b67..41a7e1d24 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1591,9 +1591,9 @@ class CartCore extends ObjectModel */ public function getPackageList($flush = false) { - static $cache = false; - if ($cache !== false && !$flush) - return $cache; + static $cache = array(); + if (isset($cache[(int)$this->id]) && $cache[(int)$this->id] !== false && !$flush) + return $cache[(int)$this->id]; $product_list = $this->getProducts(); // Step 1 : Get product informations (warehouse_list and carrier_list), count warehouse @@ -1821,7 +1821,7 @@ class CartCore extends ObjectModel ); } } - $cache = $final_package_list; + $cache[(int)$this->id] = $final_package_list; return $final_package_list; }