+91-080-41645181 Request a Quote


The Order grid in Magento admin (its under Sales -> Orders) displays following columns by default:

Order #
Purchased On
Bill to Name
Ship to Name
Shipping Country
G.T. (Base)
G.T. (Purchased)

Do you want to add a custom attribute / column to the Orders grid in Magento admin OR for that matter remove a column that you don’t need? Here is how you can do it:

  1. Create a copy of core Magento Grid.php to local directory – copy /app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php to /app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php.

  2. Let’s assume that we need to add a ‘Shipping Country’ column. Search for _prepareCollection() function and add this line:

    just before

    Then the function should look like this:

    In the above join select statement, we have basically joined the sales_flat_order_address database table which contains the Shipping Country field. Please note that the same database table also contains the Billing Country field so its important in this case to specify the ‘address_type’ either as “shipping” or as “billing” based on the Country field you want to display.

  3. Now to insert this column into the order grid, edit _prepareColumns() function. This function uses addColumn method to add different columns to the Order grid. So using the addColumn method, we can add our own shipping country column as well:

Customize Magento Admin Orders Grid

Press Esc to close