Attribute dropdown value display in magento products grid

Home / Magento / Attribute dropdown value display in magento products grid

This post useful to display custom attribute dropdown value in products grid in magento admin.

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'supplier');
$options = array();
foreach( $attribute->getSource()->getAllOptions(true, true) as $option ) {
   $options[$option['value']] = $option['label'];
}
$this->addColumn('supplier',
    array(
        'header'=> Mage::helper('catalog')->__('Supplier'),
        'width' => '80px',
        'index' => 'supplier',
        'type'  => 'options',
        'options' => $options,
));

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *