0

I'm using Magento 1.9.3.1.

So Far I managed to Add the column on order Grid together with a dropdown for filtering on the header column.

I'm in need of some assistance on where to adjust so that I can pull the data for customer group or what are the things I need to do.

So far, here's my code.

$groups = Mage::getResourceModel('customer/group_collection')
        ->addFieldToFilter('customer_group_id', array('gt'=> 0))
        ->load()
        ->toOptionHash();

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

Photo of what the upper code did.

enter image description here

What is my next Step?

Thanks for assisting me.

4
  • did you created custom module to add new column? Commented Oct 10, 2017 at 16:50
  • No Sir. I just Edited this one. app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
    – Pro_Newbie
    Commented Oct 10, 2017 at 16:53
  • Its not proper way to make changes in Core Files. Please create module and override block file. Follow this blog - inchoo.net/magento/programming-magento/… Commented Oct 10, 2017 at 17:44
  • I find it hard to understand since It does not state where should I create the file.
    – Pro_Newbie
    Commented Oct 11, 2017 at 3:25

0

Browse other questions tagged or ask your own question.