File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
app/code/Magento/SalesRule/Model Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -479,13 +479,7 @@ public function initTotals($items, Address $address)
479
479
480
480
/** @var Quote\Item $item */
481
481
foreach ($ items as $ item ) {
482
- if ($ item ->getHasChildren ()) {
483
- continue ;
484
- }
485
- if (!$ this ->isValidItemForRule ($ item , $ rule )
486
- || ($ item ->getChildren () && $ item ->isChildrenCalculated ())
487
- || $ item ->getNoDiscount ()
488
- ) {
482
+ if (!$ this ->isValidItemForRule ($ item , $ rule )) {
489
483
continue ;
490
484
}
491
485
$ qty = $ this ->validatorUtility ->getItemQty ($ item , $ rule );
@@ -517,6 +511,18 @@ public function initTotals($items, Address $address)
517
511
*/
518
512
private function isValidItemForRule (AbstractItem $ item , Rule $ rule )
519
513
{
514
+ if ($ item ->getParentItem () || $ item ->getParentItemId ()) {
515
+ return false ;
516
+ }
517
+
518
+ if (($ item ->getHasChildren () || $ item ->getChildren ()) && $ item ->isChildrenCalculated ()) {
519
+ return false ;
520
+ }
521
+
522
+ if ($ item ->getNoDiscount ()) {
523
+ return false ;
524
+ }
525
+
520
526
if (!$ rule ->getActions ()->validate ($ item )) {
521
527
return false ;
522
528
}
You can’t perform that action at this time.
0 commit comments