photo credit: luis echanove via photopin cc

Get attribute option value in Magento by ID


I had this case where I needed to get the attribute option value in Magento where I only had the ID of the option and the code of the attribute in question. After some Googling it was finally this article which showed my the solution.
However, it could be even simpler:

That’s it!

Please note: this applies only for select/multiselect attributes. Which of course makes sense, because then you would have multiple options with their respective ID’s.

Visitors give this article an average rating of 3.8 out of 5.

How would you rate this article?

2 thoughts on “Get attribute option value in Magento by ID”

  1. marcobax22 says:

    If I’m not mistaken then the given example only applies when attribute values are coming from a (multi) select. Check for it by using: $attributeDetails->usesSource();

    1. Giel Berkers says:

      Good catch! I’ve updated the article.

Leave a Reply