Sep 25, 2013

How to display product's custom dropdown attributes value in magento admin products grid

Step 1: Override the Grid.php adminhtml block (Mage_Adminhtml_Block_Catalog_Product_Grid) into local module.Assuming you have knowledge of module override.

Step2: Now add the code below in _prepareColumns() method

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

Step 3: Done

Note: Assuming you have created custom product drop down attribute 'designer' with values.

No comments:

Post a Comment