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 77namespace Magento \SalesRule \Model ;
88
99use Laminas \Validator \ValidatorInterface ;
10- use Magento \Catalog \Model \Product \Type ;
11- use Magento \ConfigurableProduct \Model \Product \Type \Configurable ;
1210use Magento \Framework \App \ObjectManager ;
1311use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
1412use Magento \Quote \Model \Quote ;
@@ -513,16 +511,10 @@ public function initTotals($items, Address $address)
513511 */
514512 private function isValidItemForRule (AbstractItem $ item , Rule $ rule )
515513 {
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+ ) {
526518 return false ;
527519 }
528520
You can’t perform that action at this time.
0 commit comments