Skip to content

Commit 0b19831

Browse files
authored
ENGCOM-3946: Fix #20229-Fatal error on product-compare page when attributes not configured #20231
2 parents 8e2ca94 + 907cc7e commit 0b19831

File tree

1 file changed

+3
-1
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/compare

1 file changed

+3
-1
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@
116116
<?php $block->getImage($item, 'product_small_image')->toHtml(); ?>
117117
<?php break;
118118
default: ?>
119-
<?= /* @escapeNotVerified */ $helper->productAttribute($item, $block->getProductAttributeValue($item, $attribute), $attribute->getAttributeCode()) ?>
119+
<?php if (is_string($block->getProductAttributeValue($item, $attribute))): ?>
120+
<?= /* @escapeNotVerified */ $helper->productAttribute($item, $block->getProductAttributeValue($item, $attribute), $attribute->getAttributeCode()) ?>
121+
<?php endif; ?>
120122
<?php break;
121123
} ?>
122124
</div>

0 commit comments

Comments
 (0)