Developer forum

Forum » Development » Getting all orders

Getting all orders


Reply
Hi there,

I would like to get all orders in eCommerce so i can iterate through them.
Is this possible?

I would like something like this:

Dynamicweb.eCommerce.Orders.OrderCollection allOrders = Dynamicweb.eCommerce.Orders.Order.getAllOrders();

Afterwards I would iterate through them, to create a CSV file with order-data.

 

Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
Hi Bo

At the moment there is no getAllOrders method on the Order class.

You can do this instead:
OrderCollection orders = Order.GetOrders("SELECT * FROM EcomOrders");

The Order.GetOrders will take a SQL statement and fill an OrderCollection based on the affected rows in the DB.

Hope this helps :)

- Jeppe
 
Reply
 Great, thanks :-)

 

You must be logged in to post in the forum