Skip to content

Commit

Permalink
Improve Product::priceCalculation performances
Browse files Browse the repository at this point in the history
  • Loading branch information
PululuK authored Apr 24, 2024
1 parent 465e6c2 commit f7556cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -3562,6 +3562,10 @@ public static function priceCalculation(
'-' . (int) $with_ecotax . '-' . (int) $id_customer . '-' . (int) $use_group_reduction . '-' . (int) $id_cart . '-' . (int) $real_quantity .
'-' . ($only_reduc ? '1' : '0') . '-' . ($use_reduc ? '1' : '0') . '-' . ($use_tax ? '1' : '0') . '-' . (int) $decimals;

if (isset(self::$_prices[$cache_id])) {
return self::$_prices[$cache_id];
}

// reference parameter is filled before any returns
$specific_price = SpecificPrice::getSpecificPrice(
(int) $id_product,
Expand All @@ -3576,10 +3580,6 @@ public static function priceCalculation(
$real_quantity
);

if (isset(self::$_prices[$cache_id])) {
return self::$_prices[$cache_id];
}

// fetch price & attribute price
$cache_id_2 = $id_product . '-' . $id_shop;
// We need to check the cache for this price AND attribute, if absent the whole product cache needs update
Expand Down

0 comments on commit f7556cc

Please sign in to comment.