Skip to content

Commit 7023235

Browse files
committed
resolved conflict
1 parent 1727c60 commit 7023235

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

app/code/Meta/Catalog/Model/Product/Feed/ProductRetriever/Configurable.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,16 @@ public function retrieve($offset = 1, $limit = self::LIMIT): array
114114
$configurableAttributes = $configurableType->getConfigurableAttributes($product);
115115

116116
foreach ($configurableType->getUsedProducts($product) as $childProduct) {
117-
/** @var Product $childProduct */
118-
$configurableSettings = ['item_group_id' => $product->getId()];
119-
foreach ($configurableAttributes as $attribute) {
120-
$productAttribute = $attribute->getProductAttribute();
121-
$attributeCode = $productAttribute->getAttributeCode();
122-
$attributeValue = $childProduct->getData($productAttribute->getAttributeCode());
123-
$attributeLabel = $productAttribute->getSource()->getOptionText($attributeValue);
124-
$configurableSettings[$attributeCode] = $attributeLabel;
125-
}
117+
if ($childProduct->getStatus() == Status::STATUS_ENABLED) {
118+
/** @var Product $childProduct */
119+
$configurableSettings = ['item_group_id' => $product->getId()];
120+
foreach ($configurableAttributes as $attribute) {
121+
$productAttribute = $attribute->getProductAttribute();
122+
$attributeCode = $productAttribute->getAttributeCode();
123+
$attributeValue = $childProduct->getData($productAttribute->getAttributeCode());
124+
$attributeLabel = $productAttribute->getSource()->getOptionText($attributeValue);
125+
$configurableSettings[$attributeCode] = $attributeLabel;
126+
}
126127
// Assign parent product name to all child products' name (used as variant name is Meta catalog)
127128
// https://developers.facebook.com/docs/commerce-platform/catalog/variants
128129
$childProduct->setName($product->getName());
@@ -132,6 +133,7 @@ public function retrieve($offset = 1, $limit = self::LIMIT): array
132133
$childProduct->setDescription($product->getDescription());
133134
}
134135
$simpleProducts[] = $childProduct;
136+
}
135137
}
136138
}
137139

0 commit comments

Comments
 (0)