2014-10-06 156 views

回答

0

感謝您的答覆。最終,我安裝了Xtento Order Export插件,這非常棒。

我不得不從頭開始創建一個新的XSL模板,但設法讓所有工作都能正常工作,包括銷售稅和交貨費用。

1

最簡單的方式做,這是

回落的Grid.php文件(應用程序/核心/法師/ Adminhtml /座/銷售/訂單/ 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', 
)); 
如果你想顯示在銷售訂單電網此列

只是忽略這些行

'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(); 
} 

這意味着我們必須將我們的自定義列值添加到集合。爲此,我們必須加入我們的表格和網格集合表。

現在去檢查後端,導出訂單。 將會添加我們的自定義列。