我正在使用 magento 1.6 并希望将客户电子邮件、优惠券代码和运输详细信息添加到销售订单网格
你们能告诉我怎么做吗
它尝试使用这个
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
但它不工作