更新时间:2023-11-29 21:35:52
复制
app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
到
app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php
copy
app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
to
app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php
然后在下一行
$collection = Mage::getResourceModel($this->_getCollectionClass());
添加
$collection->getSelect()->joinLeft(array('sfo'=>'sales_flat_order'),'sfo.entity_id=main_table.entity_id',array('sfo.customer_email'));
然后在_prepareColumns()方法中添加
then in the _prepareColumns() method add
$this->addColumn('customer_email', array(
'header' => Mage::helper('sales')->__('Customer Email'),
'index' => 'customer_email',
'filter_index' => 'sfo.customer_email',
));
注意.您将需要向所有指向main_table.field_name的addColumn调用添加一个"filter_index"
note. you will need to add a 'filter_index' to all calls to addColumn pointing to main_table.field_name