Add attribute column to admin product grid
There is already one flexible module in github for managing grid columns of any entities(orders, products, customers etc.):
https://github.com/magento-hackathon/GridControl
Found this question using Google, the selected answer works but I just tried out this module and wanted to share. It installs through Magento Connect and works extremely well.
(dead link) http://www.magentocommerce.com/magento-connect/enhanced-admin-grids-editor.html new link: https://github.com/mage-eag/mage-enhanced-admin-grids
Note: A better solution is a module approach, like in the accepted answer.
I used this blog and that works great! [link] - Jelle
Here's the gist of that post:
Copy the contents of:
/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
into a new file (if it doesn't exist):
/app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php
Find this:
$this->addColumn('sku',
array(
'header'=> Mage::helper('catalog')->__('SKU'),
'width' => '80px',
'index' => 'sku',
));
Below that, add the attribute you want in your admin product grid:
$this->addColumn('import_price',
array(
'header'=> Mage::helper('catalog')->__('Import Price'),
'width' => '150px',
'index' => 'import_price',
));
Find: $collection = Mage::getModel('catalog/product')->getCollection()
within the _prepareCollection()
function.
And add:
->addAttributeToSelect('import_price')
The article also goes into detail for adding a select dropdown list as well.
Magento: Add attribute columns in ‘Manage Products’ grid