[-] FO: Improve memory use with cart rules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17842 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-10-12 10:06:07 +00:00
parent 808815617e
commit 6e96ac5d3c
2 changed files with 41 additions and 2 deletions
+8
View File
@@ -734,6 +734,13 @@ class CartRuleCore extends ObjectModel
$reduction_value = 0;
$cache_id = 'getContextualValue_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter;
foreach ($package_products as $product)
$cache_id .= (int)$product['id_product'].'_'.(int)$product['id_product_attribute'];
if (Cache::isStored($cache_id))
return Cache::retrieve($cache_id);
// Free shipping on selected carriers
if ($this->free_shipping && ($filter == CartRule::FILTER_ACTION_ALL || $filter == CartRule::FILTER_ACTION_SHIPPING))
{
@@ -918,6 +925,7 @@ class CartRuleCore extends ObjectModel
}
}
Cache::store($cache_id, $reduction_value);
return $reduction_value;
}