Skip to content

Commit b53e1fd

Browse files
committed
MAGETWO-87521: Fixed issue #10738: Empty attribute label is displayed on product pag… #13532
- Merge Pull Request #13532 from hostep/magento2:backport-pr-11169 - Merged commits: 1. 00f29c0
2 parents 918dd05 + 00f29c0 commit b53e1fd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<argument name="at_call" xsi:type="string">getShortDescription</argument>
9595
<argument name="at_code" xsi:type="string">short_description</argument>
9696
<argument name="css_class" xsi:type="string">overview</argument>
97-
<argument name="at_label" translate="true" xsi:type="string">none</argument>
97+
<argument name="at_label" xsi:type="string">none</argument>
9898
<argument name="title" translate="true" xsi:type="string">Overview</argument>
9999
<argument name="add_attribute" xsi:type="string">itemprop="description"</argument>
100100
</arguments>
@@ -109,7 +109,7 @@
109109
<argument name="at_call" xsi:type="string">getDescription</argument>
110110
<argument name="at_code" xsi:type="string">description</argument>
111111
<argument name="css_class" xsi:type="string">description</argument>
112-
<argument name="at_label" translate="true" xsi:type="string">none</argument>
112+
<argument name="at_label" xsi:type="string">none</argument>
113113
<argument name="title" translate="true" xsi:type="string">Details</argument>
114114
</arguments>
115115
</block>

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

Lines changed: 7 additions & 1 deletion
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)->getFrontendLabel();
2733
}
@@ -34,7 +40,7 @@ if ($_attributeType && $_attributeType == 'text') {
3440

3541
<?php if ($_attributeValue): ?>
3642
<div class="product attribute <?php /* @escapeNotVerified */ echo $_className?>">
37-
<?php if ($_attributeLabel != __('none')): ?><strong class="type"><?php /* @escapeNotVerified */ echo $_attributeLabel?></strong><?php endif; ?>
43+
<?php if ($renderLabel): ?><strong class="type"><?php /* @escapeNotVerified */ echo $_attributeLabel?></strong><?php endif; ?>
3844
<div class="value" <?php /* @escapeNotVerified */ echo $_attributeAddAttribute;?>><?php /* @escapeNotVerified */ echo $_attributeValue; ?></div>
3945
</div>
4046
<?php endif; ?>

0 commit comments

Comments
 (0)