A client requested to add a column to the product grid in the admin so that they could filter by manufacturer. It would be great if Magento made this more simple to do, but it’s not that bad to just do it manually. Instead of creating a whole module to do this, I’m just overriding one file. You can make a module with it quite easily if you want.
The following was used and tested with Magento 220.127.116.11
Copy this file: /app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php and paste it here: /app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php. This will override the core file with your own without actually modifying core code.
By looking at this file, you will clearly see how Magento is setting up the columns. Find where you want to put the Manufacturer column, and paste the following code:
$manufacturer_items = Mage::getModel('eav/entity_attribute_option')->getCollection()->setStoreFilter()->join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code'); foreach ($manufacturer_items as $manufacturer_item) : if ($manufacturer_item->getAttributeCode() == 'manufacturer') $manufacturer_options[$manufacturer_item->getOptionId()] = $manufacturer_item->getValue(); endforeach; $this->addColumn('manufacturer', array( 'header'=> Mage::helper('catalog')->__('Manufacturer'), 'width' => '100px', 'type' => 'options', 'index' => 'manufacturer', 'options' => $manufacturer_options ));