Skip to content

Commit 3db593b

Browse files
committed
MC-35065: Catalog pricerules are not working with custom options as expected in Magento 2.3.0 product details page
1 parent 1a8e5c5 commit 3db593b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

app/code/Magento/Catalog/Pricing/Price/CalculateCustomOptionCatalogRule.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,12 @@ public function execute(
5454
$regularPrice = (float)$product->getPriceInfo()
5555
->getPrice(RegularPrice::PRICE_CODE)
5656
->getValue();
57-
$catalogRulePrice = $this->priceModifier->modifyPrice(
58-
$regularPrice,
59-
$product
60-
);
61-
57+
$catalogRulePrice = $product->getPriceInfo()->getPrice('final_price')->getValue();
6258
// Apply catalog price rules to product options only if catalog price rules are applied to product.
6359
if ($catalogRulePrice < $regularPrice) {
6460
$optionPrice = $this->getOptionPriceWithoutPriceRule($optionPriceValue, $isPercent, $regularPrice);
65-
$totalCatalogRulePrice = $this->priceModifier->modifyPrice(
66-
$regularPrice + $optionPrice,
67-
$product
68-
);
69-
$finalOptionPrice = $totalCatalogRulePrice - $catalogRulePrice;
61+
$discount = $catalogRulePrice / $regularPrice;
62+
$finalOptionPrice = $optionPrice*$discount;
7063
} else {
7164
$finalOptionPrice = $this->getOptionPriceWithoutPriceRule(
7265
$optionPriceValue,
@@ -78,7 +71,6 @@ public function execute(
7871
return $this->priceCurrency->convertAndRound($finalOptionPrice);
7972
}
8073

81-
8274
/**
8375
* Calculate option price without catalog price rule discount.
8476
*

0 commit comments

Comments
 (0)