Area: Episerver Commerce
Applies to versions: 10 and higher
Other versions:

Order manipulation

Recommendations [hide]

This topic describes how to create, load, save and delete orders in Episerver Commerce. See also: CartHelper is dead, long live IOrderRepository.

How it works

When manipulating orders in Episerver Commerce, see the EPiServer.Commerce.Order namespace, specifically the classes EPiServer.Commerce.Order.IOrderRepositoryEPiServer.Commerce.Order.IOrderRepositoryExtensions, EPiServer.Commerce.Order.IOrderGroupExtensions, and EPiServer.Commerce.Order.IOrderGroupFactory.

Note (Applies to version 13.13.0 and up):
If you have many ( >10) cart instances, cart cache is not really helpful, but the cache invalidation can flood the service bus.
If desired, you can use the episerver:commerce.DisableOrderRepositoryCache setting to turn off cart cache.
Warning! Only use the setting if you are absolutely sure about the consequences.

Creating orders

When creating orders using the default implementation of IOrderGroupFactory, there is always an IOrderForm in the Forms collection. There is also always an IShipment on the Shipments collection of the IForm. If you create a custom IOrderGroupFactory, assume you need this as well.

Loading orders

Saving orders

Deleting orders

Working with order forms

Working with shipments

Working with payments

Working with line items

Working with addresses

Working with notes

Do you find this information helpful? Please log in to provide feedback.

Last updated: Oct 24, 2016

Recommendations [hide]