如何在magento 1.4中添加客户电子邮件到订单网格

Thi*_*Dev 2 magento magento-1.4

我在网上找到了几种方法,但似乎都没有.有谁知道如何将客户电子邮件添加到网格中以获取Magento 1.4中的订单

Ben*_*ani 7

复制
app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

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()方法中添加

    $this->addColumn('customer_email', array(
        'header' => Mage::helper('sales')->__('Customer Email'),
        'index' => 'customer_email',
        'filter_index' => 'sfo.customer_email',
    ));
Run Code Online (Sandbox Code Playgroud)

注意.你需要在所有对指向main_table.field_name的addColumn的调用中添加一个'filter_index'