Skip to content

Commit b03ef41

Browse files
author
Anna Bukatar
committed
ACP2E-2377: Issue with Cart Price Rule on Dynamically Priced Bundles
1 parent a051525 commit b03ef41

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

app/code/Magento/SalesRule/Model/RulesApplier.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,22 @@ protected function applyRule($item, $rule, $address, $couponCode)
223223
{
224224
if ($item->getChildren() && $item->isChildrenCalculated()) {
225225
$cloneItem = clone $item;
226-
/**
227-
* validate without children
228-
*/
229-
$applyAll = $rule->getActions()->validate($cloneItem);
226+
227+
$applyToChildren = false;
230228
foreach ($item->getChildren() as $childItem) {
231-
if ($applyAll || $rule->getActions()->validate($childItem)) {
229+
if ($rule->getActions()->validate($childItem)) {
232230
$discountData = $this->getDiscountData($childItem, $rule, $address);
233231
$this->setDiscountData($discountData, $childItem);
232+
$applyToChildren = true;
234233
}
235234
}
235+
/**
236+
* validate without children
237+
*/
238+
if (!$applyToChildren && $rule->getActions()->validate($cloneItem)) {
239+
$discountData = $this->getDiscountData($item, $rule, $address);
240+
$this->setDiscountData($discountData, $item);
241+
}
236242
} else {
237243
$discountData = $this->getDiscountData($item, $rule, $address);
238244
$this->setDiscountData($discountData, $item);

0 commit comments

Comments
 (0)