Wednesday, July 27, 2016

Magento: list all values of a single attribute

 $name='product_attribue_name';
    $attributeInfo =     Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($name)->getFirstItem();
    $attributeId = $attributeInfo->getAttributeId();
    $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
    $attributeOptions = $attribute ->getSource()->getAllOptions(false);
    echo '<pre>'; print_r($attributeOptions);

No comments :

Post a Comment