Create new orders

To create an order, you must perform the following:

  1. Get the orders manager.
    Get an instance of the OrdersManager object.
  2. Get the customer.
    Get the specified customer that the order will be associated with. To do this call the GetCustomer method of the orders manager and pass the ID of the customer as an argument.
  3. Get a number for the order.
    If no number is specified for the order, you must get the next highest order number that is available. To do this, perform the following:
    1. Get an instance of the NextOrderNumber object.
    2. To get the next order number, call the Next method of the NextOrderNumber instance.
    3. Increment the current highest order number by calling the IncrementNextOrderNumber method of the orders manager.
  4. Create a new order.
    To create an instance of the Order class, call the CreateOrder method of the orders manager.
  5. Set the customer.
    To associate the customer with the order set the Customer property of the Order instance.
  6. Set the properties of the order.
    Set the properties of the Order object to the specified values.
  7. Save the changes.
    Save the changes to the manager.

Following is a code example:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?