File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
app/code/Magento/SalesRule/Model Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 7
7
namespace Magento \SalesRule \Model ;
8
8
9
9
use Laminas \Validator \ValidatorInterface ;
10
- use Magento \Catalog \Model \Product \Type ;
11
- use Magento \ConfigurableProduct \Model \Product \Type \Configurable ;
12
10
use Magento \Framework \App \ObjectManager ;
13
11
use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
14
12
use Magento \Quote \Model \Quote ;
@@ -513,16 +511,10 @@ public function initTotals($items, Address $address)
513
511
*/
514
512
private function isValidItemForRule (AbstractItem $ item , Rule $ rule )
515
513
{
516
- if ($ item ->getProductType () === Type::TYPE_SIMPLE && $ item ->getParentItemId () != null
517
- && $ item ->getParentItem ()->getProductType () === Configurable::TYPE_CODE ) {
518
- return false ;
519
- }
520
-
521
- if (($ item ->getHasChildren () || $ item ->getChildren ()) && $ item ->isChildrenCalculated ()) {
522
- return false ;
523
- }
524
-
525
- if ($ item ->getNoDiscount ()) {
514
+ if ($ item ->getParentItem () && $ item ->getParentItem ()->getProductType () === 'configurable '
515
+ || (($ item ->getHasChildren () || $ item ->getChildren ()) && $ item ->isChildrenCalculated ())
516
+ || $ item ->getNoDiscount ()
517
+ ) {
526
518
return false ;
527
519
}
528
520
You can’t perform that action at this time.
0 commit comments