Tuesday, October 1, 2013

DISPLAY LIST OF ALL MANUFACTURERS IN MAGENTO

<?php
$product = Mage::getModel('catalog/product');
   
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
                  ->setEntityTypeFilter($product->getResource()->getTypeId())
                  ->addFieldToFilter('attribute_code', 'manufacturer');

$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false);
     
echo "<pre>";
print_r($manufacturers);
echo "</pre>";

?>

No comments:

Post a Comment

Please mention your comments.......