I can't find anywhere in Commerce Manager (v9) order handling where I can change the order status except for cancelling the order? How do I for example update the order to Completed?If it is not possible to do it manually, can I by code set the order status to Completed?
It depends on how should your order be handled, but if it's a normally order (which requires shipment), you will need to:
- Release the shipment (equivalent to "the warehouse is ready")
- Switch to Shipping/Receiving/Shipments/Released For Shipping, and add the shipment to a pick list (the shipment is shipped)
- In Pick Lists, mark your shipment as complete (the shipment is delivered)
When all shipments in an order are complete, the order will be Completed.
Thanks, now I understand.
Can I programaticly update the order status to Completed? We are not handling the orders in Commerce, they are transferred to another system where they are handled.
You should be able to use OrderStatusManager to set the status of Shipments and Orders.
Setting the status programatically can be done in more than one way.
var order = OrderContext.Current.FindOrderByTrackingNumber("MyOrderNumber");
// Cancel order using OrderStatusManager. Will update the status and run the workflow 'RecalculatePurchaseOrderWorkflow'
// Or by setting the status property (which is a string), no workflow will be automatically run.
order.Status = OrderStatus.Cancelled.ToString();
Note that not all statuses can be set using the OrderStatusManager, and using the OrderStatusManager will automatically run some additional logic like running different workflows, setting shipment statuses etc.
Thanks Mattias, I will try it out!
Anaylyse your requirements before using the status manager as you may not require to run the work flows, Order Status Manager may not be best for you if your order fulfilment system is outside of EPiServer.
This might be enough for you.
purchaseOrder.Status = "Completed";
Dont use this function of order status manager to update status
Cancel order notes: http://world.episerver.com/blogs/K-Khan-/Dates/2016/2/cancel-order-notes/
Thanks K for good inout!