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

时间:2012-05-12 11:03:03

标签: magento

我正在使用magento 1.6 并希望将cutomer电子邮件,优惠券代码和运送detials添加到销售订单网格

你能告诉我怎么做吗

尝试使用此

copy
app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
to
app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php

then under the following line

$collection = Mage::getResourceModel($this->_getCollectionClass());

add

$collection->getSelect()->joinLeft(array('sfo'=>'sales_flat_order'),'sfo.entity_id=main_table.entity_id',array('sfo.customer_email'));

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',
    ));
note. you will need to add a 'filter_index' to all calls to addColumn pointing to main_table.field_name

但它不起作用

1 个答案:

答案 0 :(得分:0)

我相信我found an extension可以完全按照你的意愿行事。还有this free extension但我不知道它是否足以满足您的需求。最坏的情况,这是你的起点?而且我很确定this extension does everything you want ......我很想买它!

正如我经常说的那样,better to buy an extension, so you won't write code