Magento Forum

请问如何Export多Worksheet的订单Excel XML
 
ayuhamaro
Jr. Member
 
Total Posts:  19
Joined:  2012-05-06
 

各位好

Magento内建的订单Export机制并不会导出订单的商品
想请教各位要如何导出每订单就一个Worksheet,而Worksheet内每一笔数据就是一个商品的相关信息
举例如下

<Workbook>
    <
Worksheet ss:Name="order1">
        <
Table>
            <
Row>
                <
Cell><Data ss:Type="String">Order #</Data></Cell>
                
<Cell><Data ss:Type="String">SKU</Data></Cell>
                <
Cell><Data ss:Type="String">Qty</Data></Cell>
            </
Row>
            <
Row>
                <
Cell><Data ss:Type="Number">1</Data></Cell>
                <
Cell><Data ss:Type="String">A1</Data></Cell>
                <
Cell><Data ss:Type="Number">3</Data></Cell>
            </
Row>
            <
Row>
                <
Cell><Data ss:Type="Number">1</Data></Cell>
                <
Cell><Data ss:Type="String">A2</Data></Cell>
                <
Cell><Data ss:Type="Number">5</Data></Cell>
            </
Row>
        </
Table>
    </
Worksheet>
    <
Worksheet ss:Name="order2">
        <
Table>
            <
Row>
                <
Cell><Data ss:Type="String">Order #</Data></Cell>
                
<Cell><Data ss:Type="String">SKU</Data></Cell>
                <
Cell><Data ss:Type="String">Qty</Data></Cell>
            </
Row>
            <
Row>
                <
Cell><Data ss:Type="Number">2</Data></Cell>
                <
Cell><Data ss:Type="String">B1</Data></Cell>
                <
Cell><Data ss:Type="Number">2</Data></Cell>
            </
Row>
            <
Row>
                <
Cell><Data ss:Type="Number">2</Data></Cell>
                <
Cell><Data ss:Type="String">B2</Data></Cell>
                <
Cell><Data ss:Type="Number">3</Data></Cell>
            </
Row>
        </
Table>
    </
Worksheet>
</
Workbook>

透过对lib/Varien/Convert/Parser/Xml/Excel.php的了解,Magento本身并不支持多Worksheet的汇出,
我计划另外写一个Parser,来做多Worksheet的汇出。

但更大的问题,导出的数据需要透过
app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php的_prepareColumns()处理
但我找不出它如何调用数据库

希望大家能协助,谢谢

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top