I am trying to add the Customer Email to our adminhtml order grid. We are overriding the code in Mage/core in this file: app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
In PrepareColumns we add
$this->addColumn('customer_email', array( 'header' => Mage::helper('Sales')->__('Email'), 'width' => '100px', 'index' => 'customer_email', 'type' => 'text', ));
And in _prepareCollection we added this
$customer_entity = Mage::getSingleton('core/resource')->getTableName('customer_entity'); $collection->getSelect() ->join( $customer_entity, 'main_table.customer_id = '.$customer_entity.'.entity_id', array('customer_email' => 'email'));
The good news is, that it does add the email column
My question: Now the only problem is that when we enter an order id, or sku as filter that the result is the Magento error page .... So something is still going wrong here
What are we forgetting? Or what is the best code for Magento 1.8 to add the Email address in the order grid?