Skip to content

Commit a0d2a7d

Browse files
author
Oleksii Korshenko
authored
MAGETWO-80884: Fixed issue #10738: Don't display attribute label if defined as "none" in layout #11168
2 parents bf87946 + 67d265d commit a0d2a7d

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

Lines changed: 7 additions & 2 deletions
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)