Skip to content

Commit

Permalink
Fixed issue magento#10738: Empty attribute label is displayed on prod…
Browse files Browse the repository at this point in the history
…uct page when other language used
  • Loading branch information
maksek committed Oct 1, 2017
1 parent 9c14af7 commit 3c68ca8
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ $_attributeLabel = $block->getAtLabel();
$_attributeType = $block->getAtType();
$_attributeAddAttribute = $block->getAddAttribute();

$renderLabel = true;
// if defined as 'none' in layout, do not render
if ($_attributeLabel == 'none') {
$renderLabel = false;
}

if ($_attributeLabel && $_attributeLabel == 'default') {
$_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();
}
Expand All @@ -31,10 +37,9 @@ if ($_attributeType && $_attributeType == 'text') {
$_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
}
?>

<?php if ($_attributeValue): ?>
<div class="product attribute <?= /* @escapeNotVerified */ $_className ?>">
<?php if ($_attributeLabel != 'none'): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
<?php if ($renderLabel): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
<div class="value" <?= /* @escapeNotVerified */ $_attributeAddAttribute ?>><?= /* @escapeNotVerified */ $_attributeValue ?></div>
</div>
<?php endif; ?>

0 comments on commit 3c68ca8

Please sign in to comment.