I want an additional column in the Order(s) Grid for Admin. Assuming its Customer Group Id.
My app/etc/modules/MyProject_Adminhtml looks like:
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Adminhtml>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Sales />
</depends>
</MyProject_Adminhtml>
</modules>
</config>
My app/code/local/MyProject/Adminhtml/etc/config.xml looks like:
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Adminhtml>
<version>1.0.0</version>
</MyProject_Adminhtml>
</modules>
<global>
<blocks>
<adminhtml>
<rewrite>
<sales_order_grid>MyProject_Adminhtml_Block_Sales_Order_Grid</sales_order_grid>
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
And in app/code/local/MyProject/Adminhtml/Block/Sales/Order/Grid.php I have overridden Mage_Adminhtml_Block_Sales_Order_Grid
class MyProject_Adminhtml_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
{
protected function _prepareColumns()
{
.... unchanged code from Mage_Adminhtml_Block_Sales_Order_Grid::_prepareColumns ...
$this->addColumn('customer_group_id', array(
'header' => Mage::helper('sales')->__('Customer Group Id'),
'index' => 'customer_group_id',
'type' => 'text',
));
.... unchanged code from Mage_Adminhtml_Block_Sales_Order_Grid::_prepareColumns ...
}
}
Is there something I am missing because I don't see anything in Order Grid. I am using Magento 1.4.1.1
On Anda B's comment I wrote the following line:
var_dump($this->getLayout()->createBlock('MyProject_Adminhtml_Block_Sales_Order_Grid'));
in app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php
Then, I selected 'Create New Order' and Cancel the order to see the result of execution of var_dump, and I see the following:
/var/www/magento/var/report/72990635: line 10: syntax error near unexpected token `}' /var/www/magento/var/report/72990635: line 10: `#9 {main}";s:3:"url";s:80:"/index.php/admin/sales_order_create/cancel/key/0624033594dd63d9e145fc538f4c6bbb/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}'