I want to add a column in Sales > Order Grid for "Customer Group" after the "Ship to name" column. I know i need to modify


Could someone please help me with the proper code? Also, i don't want to build a custom module for this column. Thank you!

Using Magento 1.8

  • add customer group column in order grid right ?? Dec 10, 2019 at 13:56
  • yes, that is right
    – daniel
    Dec 10, 2019 at 13:57
  • in magento 1.8 ??? Dec 10, 2019 at 13:58
  • yes, that is right
    – daniel
    Dec 10, 2019 at 14:01

1 Answer 1


Magento 1 customer group id stored in sales_flat_order table while admin order grid fetch collection from sales_flat_order_grid so for getting customer group information must get data from sales_flat_order table.
magento order grid collection & column manage from app/code/core/Mage/Adminhtml\Block/Sales/Order/Grid.php so first join table in _prepareCollection() function as below.

$collection = Mage::getResourceModel($this->_getCollectionClass());
    'main_table.entity_id = sales_flat_order.entity_id',
now add customer group column in grid with drop-down option as below (add this in _prepareColumns() function)
$groups = Mage::getResourceModel('customer/group_collection')
    ->addFieldToFilter('customer_group_id', array('gt'=> 0))

$this->addColumn('customer_group_id', array( 'header' => Mage::helper('customer')->__('Group'), 'index' => 'customer_group_id', 'filter_index' => 'sales_flat_order.customer_group_id', 'type' => 'options', 'options' => $groups, ));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.