I am really pleased about the first stable version 1.0 of Magento which was released few days ago. Immediately I had to install the new stable on our companys server to explore the official release. When I upgraded the previous installation I discovered the new DataFlow-Features and i have to confess, that I did not expected that advancement of it’s import- and export-functionalities.
My previous problems, when I tried to import products based on CVS-files are solved.
As I mentioned in my first topic I published here I am a webdeveloper. Unfortunately nobody had an expedient answer for my questions.
Now I have got a new question, I could imagine, somebody - especially the developers - can answer me.
Is there an opportunity to import and/or export the current orders? My target is to cronjob an export of orders e.g. every hour.
That export-file (maybe XML) will be parsed and interpreted by our webapplications to exchange orderdata between Magento <-> my “exchange-layer"-solution <-> ERP-Backend (e.g. MS Dynamics NAV).
I am looking forward to your suggestions.
Best regards,
R. El-Dajani
We too are interested in import export of order info. We would be willing to join forces financially with others to help the development of this functionality or extension.
We are also looking for this functionality. Has anyone successfully created this type of functionality? We have contacted a number of Magento partners, but they all seem to be very busy with projects. Just wondering if anyone has had any luck getting this set up
I’m only a trainee and in 2 days I almost succeed to export order
My method is bad, it’s taking a long time to export and there is some mistake in the result. My method is very bad because I modified Varien class (Varien_Data_Collection) and I modified directly in core files, but I think that if you have the finance and the human resource it will be easy to develop a module. Unlikely I haven’t time to do so.
I modified _prepareCollection() in Mage_Adminhtml_Block_Sales_Order_Grid and _prepareColumns() to have some product attribute (I repeat order for each product which is in it). Because I want all the product of all my order I had to modify also Varien_Data_Collection to be able to add item with the same id and finally i use the function getCvs()on the grid.
why dont u access magento database directly and with some sql sripts copy order data to your erp system database? no need to program anything but few scritps run by cron (script can export from magento database, process it, import to desired database)
this is what i am going to do…
Yes, but want i want to export in a csv file.
Do you export all the order’s item attributes ?
It is not easy to export order and items attributes because of the database model. And if you write a script with some stuff like that : .
.. where attribute_id="245" and ....
Your script will work well with your version but maybe not with future version.
For all this reason i think it is better to use Magento class and write a php script with stuff like this :
$collectionCMD = Mage::getResourceModel('sales/order_collection') ->addAttributeToSelect('*'); ... foreach ($collectionCMD as $order) //Récupération de tout les produits commandés sous forme d'items $items= $order->getItemsCollection(); .....
nicolas46 is right, it is much better to use the Magento way of exporting. It actually isn’t that hard to export the order. I have a few methods of sending the order out now. The PHP|Architect book Guide to Programming with Magento by Mark Kismal has a REST system implemented. It basically takes the code nicolas gave and formats it in XML. You can then just navigate to a read/order and either give it a parameter or nothing and it will return the orders as XML. Very effective and easy to code against. I highly recommend it.
Usually what I have noticed when that happens is that it is because I have done an echo or a var_dump or something that outputs to screen before I intended it. I will get together the scripts and try to get all of that posted since Mark Kismal said that would be fine. Look for a post in a little while.
I think I have found an error in the book; in the function “ehoXmlArray” the xml tag is not closed (2nd row of the script).
Fixing the error does not solve the blank page and “header already sent” issue I have, though.
The generated Xml can be viewed by looking at the html source with the browser.
I look forward for the script released by alistek, thank you.