Skip to content

Commit 88f6e45

Browse files
Catalog feed generation AdditionalAttributes::getCorrectText handled for non string attributes (#629)
1 parent d6aa3c1 commit 88f6e45

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/code/Meta/Catalog/Model/Product/Feed/Builder/AdditionalAttributes.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ public function getCustomAttributeText(Product $product, string $attributeCode):
130130
*/
131131
public function getCorrectText(Product $product, string $attribute)
132132
{
133-
if ($product->getData($attribute)) {
133+
$attribute_data = $product->getData($attribute);
134+
if (!$attribute_data) {
135+
return false;
136+
}
137+
138+
if (is_string($attribute_data)) {
134139
$text = $product->getAttributeText($attribute);
135-
if (!$text) {
136-
$text = $product->getData($attribute);
137-
}
138-
return $text;
140+
return $text ?: $attribute_data;
139141
}
140-
return false;
142+
return $attribute_data;
141143
}
142144

143145
/**

0 commit comments

Comments
 (0)