Orders are created after customers complete the checkout process. The Order object itself contains only general information about the customer’s order.
The delivery group represents a group of ordered items. By default, groups are created along with an order by splitting the cart into parts, depending whether a product requires shipping or not.
Most of the order management actions are taken on the delivery groups and include changing their statuses.
There are three possible delivery group statuses:
- The default status of newly created delivery groups.
- The delivery group has been marked as shipped by a shop operator. Only
NEWgroups can be marked as shipped.
- The delivery group has been cancelled by a shop operator. Both
SHIPPEDgroups can be marked as cancelled.
Delivery Group statuses flow¶
Regular flow of statuses is from
SHIPPED. For managing states Saleor uses django-fsm package. Actions performed within changing status are placed in DeliveryGroup model and are as follows:
- Adds specified cart lines to a group with optionally charged discounts and allocates quantity in corresponding stocks. Performed during creating order in checkout process.
- Decreases quantity in corresponding stocks. Performed just after shop operator marks group as shipped.
- Deallocates or increases quantity in corresponding stocks, depending whether
SHIPPEDgroup is cancelled respectively. Performed just after shop operator marks group as cancelled.
Order status is deduced based on statuses of its delivery groups. There are two possible statuses:
- There is at least one delivery group with the
NEWstatus. An action by a shop operator is required to continue order processing.
- There are no delivery groups with the
NEWstatus. Order doesn’t require further actions by a shop operator.