Managing Orders
A Liferay order is a record of a transaction. The order lifecycle dictates the predefined series of steps that an order must progress through. Liferay provides native capabilities for managing this lifecycle, from initial shopping cart to final fulfillment. These capabilities are designed to integrate seamlessly with external OMSs and ERPs, while offering extensibility for complex or unique commerce solutions.
In this lesson, you’ll explore Liferay’s order management features and lifecycle, including facilitating cart collaboration and routing approved orders for fulfillment.
Managing Open Orders
When a product is added to the shopping cart in Liferay, it becomes an open order that is shared by the entire account. In B2B scenarios, this shared visibility means that multiple members of the buying team can collaborate on an order before it proceeds through checkout. To support complex purchasing workflows, Liferay also enables you to maintain multiple open orders or carts simultaneously. Administrators can configure the maximum number of allowed open carts, empowering buyers to separate routine restocking from one-off purchases.
Order Types
Liferay provides a single default order type, but you can configure custom order types to meet specific business needs. Creating distinct types is useful for applying different business logic, pricing, or workflows to different transactions. For example, a “Rush Order” type might trigger an expedited workflow, apply a price modifier, and restrict the available shipping options.
Applying Business Logic to Orders
Liferay provides several distinct mechanisms for applying business logic to orders:
- Order Validators: Enforce business logic when adding products to the cart. For example, you can use a validator to prevent mutually exclusive products from from being placed in the cart at the same time. Order validators require custom OSGi module development, meaning they are only compatible with Liferay PaaS, cloud-native, or self-hosted environments.
- Order Rules: Enforce business logic when orders move from the cart to checkout (e.g., enforcing a minimum order threshold). Liferay provides several OOTB order rules, but developers can also create custom rules using OSGi modules.
- Object Actions: Execute custom business logic whenever an order is created or updated. These event-driven actions are applied directly to the Commerce Order object via the Liferay UI, making them ideal for triggering webhooks to external systems.
- Workflows: Ensure orders are approved before proceeding. Buyer workflows enable buyers to review and approve orders before moving to checkout (e.g., manager approval on large purchases). Seller workflows apply after order submission and enable sellers to verify vendors or ensure regulatory compliance before initiating fulfillment (e.g., reviewing prescriptions).
Each of these methods is optional. You can use them independently or combine them to orchestrate complex buying processes.
Order Checkout and Processing
Liferay provides a standard, multi-step checkout flow for all orders, as well as a quick checkout option enabled at the channel level. You can extend and customize the checkout process using client extensions or OSGi modules. Once checkout is completed, the buyer can no longer make changes to the order. However, they can monitor the order’s status with the Placed Orders widget, which also enables them to generate new orders based on past purchases.
Enterprise organizations typically handle order processing and fulfillment through external OMS or ERP systems, so integration for order processing is often essential. Using object actions, you can notify external systems when an order successfully completes checkout. Or, you can implement scheduled jobs to export order data in bulk with batch APIs.
When an order's status changes in external systems, you can use headless APIs to update order statuses in Liferay. You can also sync shipment tracking data to provide customers with direct access to updates within the Liferay interface.
If your architecture does not rely on external fulfillment systems, you can process orders and create shipments entirely within Liferay.
Alternate Order Flows
In addition to standard checkouts, Liferay provides OOTB support for several alternate order flows:
- Order Splitting: Split a single cart into multiple, independently processed orders. This is a common requirement for marketplaces that feature diverse vendors and suppliers fulfilling their respective catalog items.
- Price on Application (Quotes): Enable quote requests for potential orders. Quotes help customers understand and negotiate pricing for highly configurable products or large bulk quantities before committing to a purchase.
- Returns and Refunds: Provide customers the ability to return specific items or entire orders. You can configure workflows for handling return shipments and processing refunds based on different payment methods.
With these flows, you have robust starting points that you can customize to fit your solution’s unique operational needs.
Exercise: Exploring Order Placement Capabilities
Minium includes order management capabilities for the entire order lifecycle. Here, you’ll explore Liferay’s order collaboration features by creating and submitting an order with different members of the S Auto Service account.
- Sign in using these credentials:
- Username:
mike@sauto.demo - Password:
learn
- Username:
- Navigate to the Catalog page (http://localhost:8080/web/minium/catalog) and add several products to the cart.
This initializes S Auto Service’s next order. Mike and other account members can continue adding and updating products and quantities until the order is placed. - Sign in using these credentials:
- Username:
brenda@sauto.demo - Password:
learn
- Username:
- Navigate to the Dashboard page (http://localhost:8080/web/minium/dashboard) and observe the in-progress cart.
Brenda can see and add products to the order Mike started. However, one of S Auto Service's customers needs a different part on an expedited basis. To handle this, Brenda can create a second, separate order. - Click the Account Selector and select Create New Order.
Creating orders through this menu provides the option to set an order name and pre-select the billing and shipping addresses. - Enter the following information and click Save.
Field Value Name Expedited Oil Pump Order Billing Address S Auto Service Shipping Address S Auto Service
- Navigate to the catalog page, find the oil pump product, and click Add to Cart.
- Click the Mini Cart icon (
) and click Submit.
This starts the checkout process. The shipping and billing addresses are already set when the Use shipping address as billing address box is selected. - Click Continue, select Expedited Delivery, and click Continue again.
- Review the order on the Order Summary page and click Continue to place the order.
Great! You’ve submitted an expedited order to Minium for further processing. You’ve also seen how Liferay’s shared carts allow multiple users within the same account to collaborate on orders.
Conclusion
Liferay provides a comprehensive suite of tools for managing the entire purchasing journey, from shared B2B carts to custom approval workflows and external system synchronization. These capabilities enable you to build a sophisticated and reliable order management process that scales with your specific business needs.
Next, you’ll explore how to build and design storefronts in Liferay.
Capabilities
Product
Education
Knowledge Base
Contact Us