Hi I want to show some custom customer address attribute in sales order grid.
How to achieve that ?
below is my Collection. I have successfully added table fields from another table but unable to add attributes from customer/address
protected function _prepareCollection()
{
$collection = Mage::getResourceModel('sales/order_grid_collection');
$collection->getSelect()->joinLeft(array('sfoa'=>'sales_flat_order_address'),
'main_table.entity_id = sfoa.parent_id AND sfoa.address_type="shipping"',array('sfoa.street', 'sfoa.city','sfoa.company','sfoa.customer_address_id'));
$collection->addFieldToFilter('customer_id', Mage::registry('current_customer')->getId())
->setIsCustomerMode(true);
Mage::log($collection);
$this->setCollection($collection);
return parent::_prepareCollection();
}
Thanks guys.