So I wanted to change the columns in the sales - order - grid

I created my own version of the Grid.php (located at app\code\local\Mage\Adminhtml\Block\Sales\Order\Grid.php)

in _prepareCollection() I added

    'main_table.entity_id = sales_flat_order.order_id',

(not correct shipping column - this just an example)

and also added the column to _prepareColumns()

Logged in to Magento admin and I have a new column - no problem

Then I wanted to add the tax from sales_flat_order

Again I added in _prepareCollection() and _prepareColumns()

    'main_table.entity_id = sales_flat_order.order_id',

Logged into Magento admin and page went crashing - never loaded and ended in temporary error (502) - both backend and frontend. Had to call support to restart.

What did I do wrong?

1 Answer 1


The field order_id does not exist in sales_flat_order. You need use entity_id instead of order_id and columns is working, it should be shipping_amount instead Shipping_column and tax_amount field to join query

so change to

    'main_table.entity_id = sales_flat_order.entity_id ',
  • So instead of listing 2 new lines with $collection-> etc just put in 1 and here I can list all the new columns from SALES_ORDER_FLAT I need?
    – Aflaursen
    Commented Apr 8, 2015 at 10:15
  • just need one line
    – Amit Bera
    Commented Apr 8, 2015 at 10:26

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.