I used

echo $_product->getColor()

but i will print code = 24 , instead of color name.


Try this :

| improve this answer | |

$_product->getColor() will return optionId not text so for Text use below code

If it is dropdown then right syntax for printing value is


And In your case its $_product->getAttributeText('color');

| improve this answer | |

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.