Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Export Orders Csv Rate Topic   - - - - -

  • robertt
  • Newbie
  • Members
  • Join Date: 12-Jan 15
  • 7 posts

Posted 04 February 2015 - 10:53 AM #1


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');
  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!


  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20955 posts

Posted 04 February 2015 - 12:19 PM #2

I think it will be better and faster to contact the developer of this module directly.
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

  • robertt
  • Newbie
  • Members
  • Join Date: 12-Jan 15
  • 7 posts

Posted 05 February 2015 - 09:01 AM #3

This module is just helping me out with calling it as a cron with a $_GET variable.
I'm using this add-on : http://www.cart-powe...ron-add-on.html
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.

  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11770 posts

Posted 05 February 2015 - 11:28 PM #4

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.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.

  • robertt
  • Newbie
  • Members
  • Join Date: 12-Jan 15
  • 7 posts

Posted 10 February 2015 - 09:52 AM #5

I have fixed this issue.
Just for people who wondering how i did this.
I never knew cs-cart has an good working api.

$get_all_orders = 'mywebshop.com/api/orders';

Thanks for the help anyways ;)