diff --git a/app/code/Magento/CatalogRule/Model/Rule/Condition/ConditionsToSearchCriteriaMapper.php b/app/code/Magento/CatalogRule/Model/Rule/Condition/ConditionsToSearchCriteriaMapper.php index 662a2fd6b38fc..83925ad59996b 100644 --- a/app/code/Magento/CatalogRule/Model/Rule/Condition/ConditionsToSearchCriteriaMapper.php +++ b/app/code/Magento/CatalogRule/Model/Rule/Condition/ConditionsToSearchCriteriaMapper.php @@ -82,9 +82,9 @@ public function mapConditionsToSearchCriteria(CombinedCondition $conditions): Se */ private function mapConditionToFilterGroup(ConditionInterface $condition) { - if ($condition->getType() === CombinedCondition::class) { + if ($condition instanceof CombinedCondition) { return $this->mapCombinedConditionToFilterGroup($condition); - } elseif ($condition->getType() === SimpleCondition::class) { + } elseif ($condition instanceof SimpleCondition) { return $this->mapSimpleConditionToFilterGroup($condition); } diff --git a/app/code/Magento/CatalogRule/Model/Rule/Condition/MappableConditionsProcessor.php b/app/code/Magento/CatalogRule/Model/Rule/Condition/MappableConditionsProcessor.php index 5ad3d383d0d2e..2fba1ac930e6e 100644 --- a/app/code/Magento/CatalogRule/Model/Rule/Condition/MappableConditionsProcessor.php +++ b/app/code/Magento/CatalogRule/Model/Rule/Condition/MappableConditionsProcessor.php @@ -67,7 +67,7 @@ private function rebuildCombinedCondition(CombinedCondition $originalConditions) $invalidConditions = []; foreach ($originalConditions->getConditions() as $condition) { - if ($condition->getType() === CombinedCondition::class) { + if ($condition instanceof CombinedCondition) { $rebuildSubCondition = $this->rebuildCombinedCondition($condition); if (count($rebuildSubCondition->getConditions()) > 0) { @@ -79,7 +79,7 @@ private function rebuildCombinedCondition(CombinedCondition $originalConditions) continue; } - if ($condition->getType() === SimpleCondition::class) { + if ($condition instanceof SimpleCondition) { if ($this->validateSimpleCondition($condition)) { $validConditions[] = $condition; } else {