Skip to content

Commit 40842d3

Browse files
committed
ACP2E-2376: avoid double calculation for configurable and child product while applying discount for configurable
1 parent 9809192 commit 40842d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
namespace Magento\SalesRule\Model;
88

99
use Laminas\Validator\ValidatorInterface;
10+
use Magento\Catalog\Model\Product\Type;
11+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
1012
use Magento\Framework\App\ObjectManager;
1113
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1214
use Magento\Quote\Model\Quote;
@@ -511,7 +513,8 @@ public function initTotals($items, Address $address)
511513
*/
512514
private function isValidItemForRule(AbstractItem $item, Rule $rule)
513515
{
514-
if ($item->getParentItem() || $item->getParentItemId()) {
516+
if ($item->getProductType() === Type::TYPE_SIMPLE && $item->getParentItemId() != null
517+
&& $item->getParentItem()->getProductType() === Configurable::TYPE_CODE) {
515518
return false;
516519
}
517520

0 commit comments

Comments
 (0)