Skip to content

Commit 3c68ca8

Browse files
committed
Fixed issue #10738: Empty attribute label is displayed on product page when other language used
1 parent 9c14af7 commit 3c68ca8

File tree

1 file changed

+7
-2
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/view

1 file changed

+7
-2
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/attribute.phtml

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ $_attributeLabel = $block->getAtLabel();
2222
$_attributeType = $block->getAtType();
2323
$_attributeAddAttribute = $block->getAddAttribute();
2424

25+
$renderLabel = true;
26+
// if defined as 'none' in layout, do not render
27+
if ($_attributeLabel == 'none') {
28+
$renderLabel = false;
29+
}
30+
2531
if ($_attributeLabel && $_attributeLabel == 'default') {
2632
$_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();
2733
}
@@ -31,10 +37,9 @@ if ($_attributeType && $_attributeType == 'text') {
3137
$_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
3238
}
3339
?>
34-
3540
<?php if ($_attributeValue): ?>
3641
<div class="product attribute <?= /* @escapeNotVerified */ $_className ?>">
37-
<?php if ($_attributeLabel != 'none'): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
42+
<?php if ($renderLabel): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
3843
<div class="value" <?= /* @escapeNotVerified */ $_attributeAddAttribute ?>><?= /* @escapeNotVerified */ $_attributeValue ?></div>
3944
</div>
4045
<?php endif; ?>

0 commit comments

Comments
 (0)