0

I am trying to display the label for my attribute (i.e. 'color:'). I have added the following code to my 'media.phtml' file:

<div class="color-option">
<?php echo $_product->getAttributeText("color"); ?>
</div>

Which displays the value. But how do I get it to also show the label?

1 Answer 1

3
$_product->getResource()->getAttribute('color')->getStoreLabel();

Copied from StackOverflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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