Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Export orders
 
oehoff
Jr. Member
 
Total Posts:  18
Joined:  2007-12-07
Trondheim, Norway
 

Hi,
I need to setup magento to export orders to an ERP system, but not sure how....
Are there any documentation on how to export orders in DataFlow?

best regards
Ørjan

 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_w
Sr. Member
 
Total Posts:  290
Joined:  2008-01-04
 

Hello Orjan,
In order to export orders using Dataflow, at this stage you would need to write an adapter and parser for the sales orders. I don’t know of any documentation yet, but you could look at app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php and app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php to see how the product export works. There is also a similar adapter and parser for customers. If the proper order adapter and parser are in place, you could call them through an advanced profile in dataflow similar to this:

<action type="sales/convert_adapter_order" method="load">
<var name="store"><![CDATA[1]]></var>
</action>

<action type="sales/convert_parser_order" method="unparse">
<var name="store"><![CDATA[1]]></var>
</action>

<action type="varien/convert_mapper_column" method="map">
</action>

<action type="varien/convert_parser_csv" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
</action>

<action type="varien/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/</var>
<var name="filename"><![CDATA[orders.txt]]></var>
</action>

But, like I said in order for the advanced profile to work, at this stage you’d have to write the order adapter and parser yourself. I know the staff at Varien is working on a sampling of adapters and parsers to be released with v1.0, and I might imagine that this particular one might be on the list, but I can’t confirm this.

Regards,
Dan

 
Magento Community Magento Community
Magento Community
Magento Community
 
amine2005
Jr. Member
 
Total Posts:  23
Joined:  2008-09-11
 

hello community

i implement adapters and parser file
in which file i need to change code

<action type="sales/convert_adapter_order" method="load">
<var name="store"><![CDATA[1]]></var>
</action>

<action type="sales/convert_parser_order" method="unparse">
<var name="store"><![CDATA[1]]></var>
</action>

<action type="varien/convert_mapper_column" method="map">
</action>

<action type="varien/convert_parser_csv" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
</action>

<action type="varien/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/</var>
<var name="filename"><![CDATA[orders.txt]]></var>
</action>

 
Magento Community Magento Community
Magento Community
Magento Community
 
amine2005
Jr. Member
 
Total Posts:  23
Joined:  2008-09-11
 

in profile .php simply this code is genrated automatically
if ($import) {
$numberOfRecords = isset($p[’import’][’number_of_records’]) ? $p[’import’][’number_of_records’] : 1;
$decimalSeparator = isset($p[’import’][’decimal_separator’]) ? $p[’import’][’decimal_separator’] : ‘.’;
$parseFileXmlInter .= ‘ <var name="number_of_records">’
. $numberOfRecords . ‘</var>’ . $nl;
$parseFileXmlInter .= ‘ <var name="decimal_separator"><![CDATA[’
. $decimalSeparator . ‘]]></var>’ . $nl;
if ($this->getDataTransfer()===’interactive’) {
$xml = $parseFileXmlInter;
$xml .= ‘ <var name="adapter">’.$adapters[$this->getEntityType()].’</var>’.$nl;
$xml .= ‘ <var name="method">parse</var>’.$nl;
$xml .= ‘</action>’;
} else {
$xml = $fileXml;
$xml .= $parseFileXmlInter;
$xml .= ‘ <var name="adapter">’.$adapters[$this->getEntityType()].’</var>’.$nl;
$xml .= ‘ <var name="method">parse</var>’.$nl;
$xml .= ‘</action>’;
}

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