Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Update Discount.php #79

Open
wants to merge 1 commit into
base: magento-1.9
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/code/core/Mage/SalesRule/Model/Quote/Discount.php
Original file line number Diff line number Diff line change
@@ -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 {
/**