Get manufacturers (and any attribute) list

Last modified by joyously on Thu, June 24, 2010 16:49
Source|Old Revisions  
  1. $product = Mage::getModel('catalog/product');
  2.  
  3. $attributes = Mage::getResourceModel('eav/entity_attribute_collection')
  4.     ->setEntityTypeFilter($product->getResource()->getTypeId())
  5.     ->addFieldToFilter('attribute_code', 'manufacturer') // This can be changed to any attribute code
  6.     ->load(false);
  7.  
  8. $attribute = $attributes->getFirstItem()->setEntity($product->getResource());
  9.  
  10. /* @var $attribute Mage_Eav_Model_Entity_Attribute */
  11. $manufacturers = $attribute->getSource()->getAllOptions(false);



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs