Skip to content

Commit f47033c

Browse files
committed
MC-22813: Changing Quantity and Adding to cart through Quick Order throws exception
- Add guard for getChildren
1 parent 6da226d commit f47033c

File tree

1 file changed

+4
-1
lines changed
  • app/code/Magento/ConfigurableProduct/Plugin/SalesRule/Model/Rule/Condition

1 file changed

+4
-1
lines changed

app/code/Magento/ConfigurableProduct/Plugin/SalesRule/Model/Rule/Condition/Product.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ private function getProductToValidate(
5656
$attrCode = $subject->getAttribute();
5757

5858
/* Check for attributes which are not available for configurable products */
59-
if ($product->getTypeId() == Configurable::TYPE_CODE && !$product->hasData($attrCode)) {
59+
if ($product->getTypeId() == Configurable::TYPE_CODE &&
60+
!$product->hasData($attrCode) &&
61+
count($model->getChildren())
62+
) {
6063
/** @var \Magento\Catalog\Model\AbstractModel $childProduct */
6164
$childProduct = current($model->getChildren())->getProduct();
6265
if ($childProduct->hasData($attrCode)) {

0 commit comments

Comments
 (0)