You need to extend the Category Product Grid block.
For this create a new module. Let's call it Easylife_Catalog
.
You need the following files.
app/etc/modules/Easylife_Catalog.xml
- the declaration file
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Catalog>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Catalog />
<Mage_Adminhtml />
</depends>
</Easylife_Catalog>
</modules>
</config>
app/code/local/Easylife/Catalog/etc/config.xml
- the configuration file
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Catalog>
<version>0.0.1</version>
</Easylife_Catalog>
</modules>
<global>
<blocks>
<adminhtml>
<rewrite>
<catalog_category_tab_product>Easylife_Catalog_Block_Adminhtml_Category_Tab_Product</catalog_category_tab_product>
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
app/code/local/Easylife/Catalog/Block/Adminhtml/Category/Tab/Product.php
- your new block
<?php
class Easylife_Catalog_Block_Adminhtml_Category_Tab_Product
extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product {
public function _preparePage() {
$this->getCollection()->joinAttribute(
'status',
'catalog_product/status',
'entity_id',
null,
'inner',
$this->_getStore()->getId()
);
return parent::_preparePage();
}
public function _prepareColumns(){
$this->addColumnAfter('status', array(
'header' => Mage::helper('catalog')->__('Status'),
'index' => 'status',
'type' => 'options',
'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
), 'sku');
return parent::_prepareColumns();
}
protected function _getStore()
{
$storeId = (int) $this->getRequest()->getParam('store', 0);
return Mage::app()->getStore($storeId);
}
}
Clear the cache and give it a go.