[-] Core: Cache of Cart::getPackageList is now per cart
This commit is contained in:
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user