Delete all orders

To delete all existing orders, perform the following:

  1. Get the orders manager.
    Get an instance of the OrdersManager object.
  2. Get all existing orders.
    To do this call the GetOrders method of the orders manager.
    As a result, you get a queryable collection of all created order objects.
  3. Iterate through the orders collection.
  4. Delete the orders
    Call the DeleteOrder
    method of the orders manager.
  5. Save the changes to the orders manager.

To delete all existing orders, use the following code sample:

All orders are deleted.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?