diff --git a/vendor/magento/module-sales-rule/Model/RulesApplier.php b/vendor/magento/module-sales-rule/Model/RulesApplier.php index ae2beb0..6429054 100644 --- a/vendor/magento/module-sales-rule/Model/RulesApplier.php +++ b/vendor/magento/module-sales-rule/Model/RulesApplier.php @@ -186,16 +186,22 @@ class RulesApplier { if ($item->getChildren() && $item->isChildrenCalculated()) { $cloneItem = clone $item; - /** - * validate without children - */ - $applyAll = $rule->getActions()->validate($cloneItem); + + $applyToChildren = false; foreach ($item->getChildren() as $childItem) { - if ($applyAll || $rule->getActions()->validate($childItem)) { + if ($rule->getActions()->validate($childItem)) { $discountData = $this->getDiscountData($childItem, $rule, $address); $this->setDiscountData($discountData, $childItem); + $applyToChildren = true; } } + /** + * validate without children + */ + if (!$applyToChildren && $rule->getActions()->validate($cloneItem)) { + $discountData = $this->getDiscountData($item, $rule, $address); + $this->setDiscountData($discountData, $item); + } } else { $discountData = $this->getDiscountData($item, $rule, $address); $this->setDiscountData($discountData, $item);