Skip to main content

Posts

Showing posts from December, 2017

Magento add Customer Email to adminhtml order grid

Just copy Grid.php to   app/code/local/Mage/Adminhtml/Block/Sales/Order/ Then appendsales_flat_order table to collection protected function _prepareCollection () { $collection = Mage :: getResourceModel ( $this -> _getCollectionClass ()); $collection -> getSelect ()-> join ( 'sales_flat_order' , 'main_table.entity_id = sales_flat_order.entity_id' , array ( 'customer_email' )); $this -> setCollection ( $collection ); return parent :: _prepareCollection (); }; And a addColumn to _prepareColumns() $this -> addColumn ( 'customer_email' , array ( 'header' => Mage :: helper ( 'sales' )-> __ ( 'Payment method' ), 'index' => 'customer_email' , 'filter_index' => 'sales_flat_order.customer_email' , ));