Export Orders Csv

Hello,



First, let me explain my problem.

I want to make an cronjob that automatic exports the orders to a *.csv file format.

I want a cronjob because i can send the order csv file to my transporter.



I've installed the add-on “Admin actions by cron”.

I tried to get the data in the cronjob, I was able to get the order schema but now i'm stuck.

Someone can help me out?



This is the code i got for getting the orders scheme.



if($_REQUEST['export_orders'] == 'y')
{
$scheme_data = fn_get_schema('exim','orders','php');
print_r($scheme_data);
echo('Export orders!');
}




Is this the way that i should be working, or is there something else, which is lot easier and saves me lots of time?



Thanks in regards!



Robert

I think it will be better and faster to contact the developer of this module directly.

This module is just helping me out with calling it as a cron with a $_GET variable.

I'm using this add-on : [url=“Admin actions by cron: CS-Cart add-on by Cart-Power”]http://www.cart-power.com/cs-cart-admin-actions-by-cron-add-on.html[/url]

So it kinda has nothing to do with the module.

I just want to know if its possible to get order data from a scheme, or if there is an other method for getting my orders data.

Easiest way in the PHP side of things is to use:

$order_info = fn_get_order_info($order_id)

which will generally get you almost everything you need related to the order. You can then use json_encode($order_info) to get it into a transportable format or you can just extract the fields you want into a csv. But note that csv is not a very good format for order info since csv doesn't really account for things like a variable number of products in the order. It usually takes 2 csv's and then to merge them with the foreign key being the order_id…



But like many things, there are a lot of ways to skin a cat. So YMMV depending on your needs.

I have fixed this issue.

Just for people who wondering how i did this.

I never knew cs-cart has an good working api.


<br />
$get_all_orders = 'mywebshop.com/api/orders';<br />

```<br />
<br />
Thanks for the help anyways <img src="upload://ssa1U17ndImgNZSdwFNmOF2yUgM.png" class="bbc_emoticon" alt=";)">