2

I am trying to change the SKU attribute label from "SKU" to "Item" on the Product Page on the storefront by adding a label to the attribute in Admin Panel by going to

Stores > Attributes > Product

selecting "SKU" attribute in the grid and adding a label under

Manage Labels > Default Store View

column.

It seems that the attribute label for SKU which is displayed on the Product Page on the storefront will only change if I modify the Default Label in Admin Panel.

All other attributes are properly reflected on the storefront (e.g. color, size, etc).

During my investigation, I have found out that the template responsible for rendering the SKU is module-catalog/view/frontend/templates/product/view/attribute.phtml. However, the attribute label is not translatable therefore I cannot use translations files to change the attribute label. On the other side, I understand why the attributes displayed via above template are not translatable as - I think - the attributes labels should be changed from the Admin Panel via Manage Labels facility as described above.

Is this a bug?

2

Seems that Magento shows always the attribute's frontend label and not the attribute's store label in that template. You can fix that by replacing the line 26 in the file

module-catalog/view/frontend/templates/product/view/attribute.phtml

with the code line below

$_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.