cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.9.2 admin add street column in Customers by number of orders report

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento 1.9.2 admin add street column in Customers by number of orders report

I want to add street column in admin->report->Customers by number of orders.(Magento 1.9.2)

I have tried adding join query in 'app\code\core\Mage\Reports\Model\Resource\Customer\Orders\Collection.php'

protected function _joinFields($from = '', $to = '')
{   

    $this->joinCustomerName()
        ->groupByCustomer()
        ->addOrdersCount()                 
        ->addAttributeToFilter('main_table.created_at', array('from' => $from, 'to' => $to, 'datetime' => true))
        ->join(array('p' => 'sales/order_address'), 'main_table.entity_id = p.parent_id', array(
                'street'
        ));

        return $this;
}

And in 'app\code\core\Mage\Adminhtml\Block\Report\Customer\Orders\Grid.php'

$this->addColumn('street', array(
        'header'    => $this->__('street'),
        'sortable'  => false,
        'index'     => 'street'
    ));

I am getting the main table data but not the fields I have joined.

I have tried this, any other method is always welcome. Thanks in advanced.