OMS Change Order:
The BLC OMS change order functionality utilizes the "shop as guest" mechanism to modify an order that has already been submitted, but not yet sent to fulfillment.
Behind the scenes:
- From the BLC Admin, the CSR can "block" an order and proceed to create a change order.
- The process of changing an order involves several things:
- It utilizes the CSR "Shop as Guest" functionality to redirect the current CSR onto the
Sitewith "CSR_OWNED" priveleges - Once on site, the CSR will take control of a
CSR_OWNEDcloned version of the most recent version of the current order. - Once an order is cloned, the state for the cloned order will be:
OrderStatus.CSR_OWNEDSecondaryOrderStatus.SUBMITTEDChangeOrderStatus.CHANGE_IN_PROCESS- Order Number = 123456789-12345
- Parent Order = Original Order
- The state for the original order will still be:
OrderStatus.SUBMITTEDSecondaryOrderStatus.BLOCKEDChangeOrderStatus.NA- Order Number = 123456789
- The CSR will be directed to a "CSR Review Change Order Page" where they can modify various aspects of the order they are working on. For example, shipping address/order payments/override pricing, etc...
- From this page, the CSR also has the ability to go and "shop for customer" which will redirect to the
rootof the currentSitecontext. From here, the CSR can add/remove items from their cart as a normal customer would. All extensions and customizations on top of the add to cart or pricing workflows can still be leveraged since this funcitonality is being served fromSite.
- It utilizes the CSR "Shop as Guest" functionality to redirect the current CSR onto the
- Once the CSR has finished modifying the order, they can finish the process by clicking
completechange order at the top of the CSR action toolbar. - The process of completing a "change order" involves several steps:
- the
blCompleteChangeOrderWorkflowwill be called in order to finalize the process (the activities can be extended/customized) as with any other workflow activity: - the
CompleteChangeOrderActivitywill do the following: - The cloned order will now become the current working version of the order:
OrderStatus.SUBMITTEDSecondaryOrderStatus.SUBMITTEDChangeOrderStatus.CHANGE_COMPLETE- Order Number = 123456789
- The state for the original order will now be archived and the order number switched:
OrderStatus.ARCHIVEDSecondaryOrderStatus.BLOCKEDChangeOrderStatus.NA- Order Number = 123456789-12345
- By default, the blocking workflow will automatically be called after the change order workflow is complete.
- the
Note: You may wish to "turn off" certain activities on Site if you are in the context of a change order. For example, you may not want to re-evaluate promotions or promotional pricing. If so, you can extend the appropriate activities (e.g. org.broadleafcommerce.core.pricing.service.workflow.OfferActivity and override the following method to be something like:
@Override
public boolean shouldExecute(ProcessContext<Order> context) {
Order order = context.getSeedData();
if (order != null && order instanceof OMSOrder &&
ChangeOrderStatus.CHANGE_IN_PROCESS.equals(((OMSOrder) order).getChangeOrderStatus())) {
return false;
}
return super.shouldExecute(context);
}