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.
How to display product's custom dropdown attributes value in magento admin products grid How to display product's custom dropdown attributes value in magento admin products grid Reviewed by Web Technology Funda on 4:53:00 AM Rating: 5

No comments

Free! Free!Free! Subscribe to Get Free PHP (Magento) tutorial Update in Your Inbox!!! Hurry Up!!!