Create addresses of orders
There are two types of order addresses:
- Billing order address
Represents the address where the bill or the invoice is sent.
- Shipping order address
Represents the address where the purchase is sent or shipped.
The type of the address is specified via the Telerik.Sitefinity.Ecommerce.Orders.Model.AddressType enumeration.
To create an order address, you must perform the following:
- Get the orders manager.
Get an instance of the OrdersManager object.
- Get the order.
Get the order that the address will be associated with. For more information, see For developers: Query orders.
- Create a new order address.
Create an instance of the OrderAddress class by calling the CreateOrderAddres method of the manager.
- Set the properties.
Set the properties of the instance to the specified values.
- Associate the address with the order.
Set the Parent property of the OrderAddress instance to the Order instance. Add the order address to the Addresses collection of the order.
- Save the changes.
Save the changes to the manager.
Use the following code sample: