Add attribute column to admin product grid

The question:

I want to add a custom attribute to the Admin Product Grid.
The attribute got the attribute code import_price.

How can we add this column?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

There is already one flexible module in github for managing grid columns of any entities(orders, products, customers etc.):

Method 2

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:
into a new file (if it doesn’t exist):

Find this:

    'header'=> Mage::helper('catalog')->__('SKU'),
    'width' => '80px',
    'index' => 'sku',

Below that, add the attribute you want in your admin product grid:

    'header'=> Mage::helper('catalog')->__('Import Price'),
    'width' => '150px',
    'index' => 'import_price',

Find: $collection = Mage::getModel('catalog/product')->getCollection() within the _prepareCollection() function.

And add:


The article also goes into detail for adding a select dropdown list as well.

Magento: Add attribute columns in ‘Manage Products’ grid

Method 3

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)
new link:

Method 4

Add below code to select attribuet in _prepareCollection function of product grid
Mage_Adminhtml_Block_Catalog_Product_Grid before $this->setCollection($collection) line.

$attributeCode = 'qc_status';//here your attribute code
        $collection->joinAttribute($attributeCode, 'catalog_product/'.$attributeCode, 'entity_id', null, 'left');

And then below code for column in _prepareColumns function of grid.

$attributeCodeConfig ='qc_status';//Your attribute code...

        $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', $attributeCodeConfig);

        $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
        $attributeData = $attribute->getData();
        $frontEndLabel = $attributeData['frontend_label'];

        $attributeOptions = $attribute->getSource()->getAllOptions();
        $b = new Mage_Catalog_Model_Resource_Eav_Attribute();
        $attributeOptions2 = array();
        foreach ($attributeOptions as $value) {
            if(!empty($value['value'])) {
                $attributeOptions2[$value['value']] = $value['label'];


        if(count($attributeOptions2) > 0) {
                    'header'=> Mage::helper('catalog')->__($frontEndLabel),
                    'width' => '80px',
                    'index' => $attributeCodeConfig,
                    'type'  => 'options',
                    'options' => $attributeOptions2,

        } else {
                    'header'=> Mage::helper('catalog')->__($frontEndLabel),
                    'width' => '80px',
                    'index' => $attributeCodeConfig,


All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment