From 33326f04c606054aa08d87e724195c69f8df82e4 Mon Sep 17 00:00:00 2001 From: DD <43253265+dotdirect@users.noreply.github.com> Date: Fri, 4 Oct 2019 21:09:21 -0400 Subject: [PATCH] Update Discount.php when admin set no discount apply for parent item, all child items shouldn't have discount also. --- app/code/core/Mage/SalesRule/Model/Quote/Discount.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php index 6e10d3b2c6..44443752df 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php @@ -82,6 +82,15 @@ public function collect(Mage_Sales_Model_Quote_Address $address) if ($item->getNoDiscount()) { $item->setDiscountAmount(0); $item->setBaseDiscountAmount(0); + /** + * when admin set no discount apply for parent item, all child items shouldn't have discount also. + */ + if($item->getHasChildren()) { + foreach ($item->getChildren() as $child) { + $child->setDiscountAmount(0); + $child->setBaseDiscountAmount(0); + } + } } else { /**