I have problem when I try to load multiselect values for product. I have:


But these can give me only "sport type" Ids, not and names. How to get names?

3 Answers 3


I suppose you want to display the value of the multiselect attribute named sport_types in the frontend. To do so you need to follow below steps:

$sportTypes = explode(",",$_product->getResource()

foreach($sportTypes as $key => $value){
        echo $value;
  • My Magento version uses an extra space for delimiter, i.e. ", " instead of ",". You might need that too.
    – mimarcel
    Jul 8, 2015 at 17:25

Better use:

foreach($product->getAttributeText('sport_types') as $type) {
    echo $type;

Amit already mentioned this but I want to make sure, that everyone understands, that getAttributeText returns you the attribute name for selects and an array for multiselects.

  • Much cleaner solution than the others. Thanks Fabian! Jan 26, 2016 at 13:27


$product->getSportTypes(); give array of option ids

And below give array of option

$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','sport_types');
 $collection =Mage::getResourceModel('eav/entity_attribute_option_collection')
                echo "<pre>";
                echo "</pre>";

For getting all Selected option of shop_types attribute try below code

  • These only works if only one value is selected, but if i select more, it will return false.
    – Milos
    Jul 7, 2014 at 11:27
  • then what you want???want list all option of this attribute
    – Amit Bera
    Jul 7, 2014 at 11:30
  • I want to get all names from sport types that are selected
    – Milos
    Jul 7, 2014 at 11:31
  • over all products or only this products
    – Amit Bera
    Jul 7, 2014 at 11:36
  • For current product, load sport types names as string
    – Milos
    Jul 7, 2014 at 11:45

Your Answer

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

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