简单的方法是
退回Grid.php文件(app / core / Mage / Adminhtml / Block / Sales / Order / Grid.php)
然后像下面一样添加您的自定义列:
//New columns added but hidded
$this->addColumn('custom_column', array(
'header' => Mage::helper('sales')->__('Custom Column'),
'index' => 'custom_column',
'column_css_class'=>'no-display',
'header_css_class'=>'no-display',
));
也改变了
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()->joinLeft('sales_flat_order', 'main_table.entity_id = sales_flat_order.entity_id',array('custom_column'));
$this->setCollection($collection);
return parent::_prepareCollection();
}
这意味着我们必须将自定义列值添加到集合中。为此,我们必须将表与网格收集表连接起来。
现在去检查后端,导出订单。将添加我们的自定义列。