Skip to main content

go to app/code/local/mage/adminhtml/block/sales/order/grid.php **app/code/local/mage/adminhtml/block/sales/order/grid.php

add this code in protected function _prepareCollection()

$table1 = Mage::getSingleton('core/resource') ->getTableName('sales_flat_order_address'); $shipping = "(select max(t.street) from $table1_prepareCollection() as t where t.parent_id = main_table.entity_id )"; $collection->getSelect()->from('', "$shipping as shipping_city");

$table1 = Mage::getSingleton('core/resource')
            ->getTableName('sales_flat_order_address');
$shipping = "(select max(t.street) from `$table1` as t  where   t.parent_id = main_table.entity_id )";
        $collection->getSelect()->from('', "$shipping as shipping_city");

and in protected function _prepareColumns()_prepareColumns(), add following code

$this->addColumn('shipping_city', array( 'header' => Mage::helper('sales')->__('Shipping Address'), 'index' => 'shipping_city', 'filter_index' => 'shipping.city' ));

$this->addColumn('shipping_city', array(
            'header' => Mage::helper('sales')->__('Shipping Address'),
            'index' => 'shipping_city',
            'filter_index' => 'shipping.city'
        ));

go to app/code/local/mage/adminhtml/block/sales/order/grid.php **

add this code in protected function _prepareCollection()

$table1 = Mage::getSingleton('core/resource') ->getTableName('sales_flat_order_address'); $shipping = "(select max(t.street) from $table1 as t where t.parent_id = main_table.entity_id )"; $collection->getSelect()->from('', "$shipping as shipping_city");

and in protected function _prepareColumns(), add following code

$this->addColumn('shipping_city', array( 'header' => Mage::helper('sales')->__('Shipping Address'), 'index' => 'shipping_city', 'filter_index' => 'shipping.city' ));

go to app/code/local/mage/adminhtml/block/sales/order/grid.php

add this code in protected function _prepareCollection()

$table1 = Mage::getSingleton('core/resource')
            ->getTableName('sales_flat_order_address');
$shipping = "(select max(t.street) from `$table1` as t  where   t.parent_id = main_table.entity_id )";
        $collection->getSelect()->from('', "$shipping as shipping_city");

and in protected function _prepareColumns(), add following code

$this->addColumn('shipping_city', array(
            'header' => Mage::helper('sales')->__('Shipping Address'),
            'index' => 'shipping_city',
            'filter_index' => 'shipping.city'
        ));
Source Link

go to app/code/local/mage/adminhtml/block/sales/order/grid.php **

add this code in protected function _prepareCollection()

$table1 = Mage::getSingleton('core/resource') ->getTableName('sales_flat_order_address'); $shipping = "(select max(t.street) from $table1 as t where t.parent_id = main_table.entity_id )"; $collection->getSelect()->from('', "$shipping as shipping_city");

and in protected function _prepareColumns(), add following code

$this->addColumn('shipping_city', array( 'header' => Mage::helper('sales')->__('Shipping Address'), 'index' => 'shipping_city', 'filter_index' => 'shipping.city' ));