Skip to main content
1 of 2
Prashant Valanda
  • 12.7k
  • 5
  • 43
  • 69

Add below code in collection of app/code/local/Atwix/ExtendedGrid/Model/Observer.php:

$collection = $observer->getOrderGridCollection();
        $select = $collection->getSelect();
        $select->joinLeft(array('payment' => $collection->getTable('sales/order_payment')), 'payment.parent_id=main_table.entity_id', array('payment_method' => 'method'));

        $select->join(
                array('address' => $collection->getTable("sales/order_address")),
                'main_table.entity_id = address.parent_id AND address.address_type = "shipping"',
                array('postcode')
            );

        $select->join('sales_flat_order_item', '`sales_flat_order_item`.order_id=`main_table`.entity_id', array('skus' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.sku SEPARATOR ", ")')));
        $select->group('main_table.entity_id'); 

add below code in grid file in function _prepareColumns

$this->addColumn('postcode',
        array(
            'header'    => Mage::helper('sales')->__('Postcode'),
            'index'     => 'postcode'
        )
    );
Prashant Valanda
  • 12.7k
  • 5
  • 43
  • 69