Order statuses

Created by Vidar Langberget

Orders get different OrderStatuses after certain action that happen to the order. Below is a description of how and when the different order statuses is set.

Basket

When a customer clicks on an "Add to cart" button, the systems tries to find  a Order that is related to the current session/user that has status "Basket". If no order with order status "Basket" is found, a new order is created (if you use the AddToCart control), and OrderStatus is set to "Basket".

A user can't have more than one order with a Basket order status.

If an anonymous user that has an Order with OrderStatus Basket logs inn, and the user also has a related order with OrderStatus basket, the order items from the anonymous order is moved to the user's order, and the anonymous order is deleted.

When the user is anonymous, the order is found via a cookie stored on the users machine. If the user is an actual Relatude user, the SystemUser content class has an Orders relation that is queried to find any order with order status basket.

By default, basket orders are not shown in the orders tab in the e-commerce module. Basket orders can be shown by using the OrderStatus filter.

Ordered

When the payment flow is finished, and the user clicks the Order button, the system processes the payment. If the payment is successful, and two phase payment is used, the OrderStatus is set to Ordered.

The system allows you to order products that aren't in stock. If you want to stop that, you have to add a check yourself to the order flow.

Shipped

The system doesn't control when you set the OrderStatus to shipped, but it can be set manually in the Orders tab in the e-commerce module. It can also be set programmatically if you want to integrate with an external system for order fullfilment.

When the OrderStatus is set to Shipped, the system send an "Order shipped" email, if an ShopEmail is set to the "Order shipped email" in the settings part of the e-commerce module.

Most credit card payment methods works in the way that when a payment is approved, the amount is only reserved in your customers account, and the actual payment isn't done until the order is shipped.

While you are free to set the order status to shipped at any time, even if the you haven't shipped the order, most payment solutions demand that you don't draw the money before the order is sent from your warehouse.

Partly shipped

Sometimes when you get an order with multiple items, some are in stock, while some might be backordered. By using the PartlyShipped order, you're able to split the order into multiple shipments. When you make a partial shipment, the payment method captures the amount equal to the price of the shipped items.

You manually select the items that you want to include in the different shipments. You can also decide when you want to capture the shipping amount. If you don't capture the shipping amount manually, the system automatically adds the shipping amount to the last shipment.

Cancelled

Sometimes a customer wishes to cancel an order due to different reasons. This can be done from the Orders tab in the e-commerce module.

Refunded

When an order is refunded, the order status is set to Refunded. Payment is returned to the customer.

Saved

The system only allows one order with orderstatus "Basket". Sometimes you want to store multiple baskets per user. To allow this, you must use the Saved status to have more than one order outside the formal order process.