Using Order Types¶
Available Liferay DXP 7.4 U4+/GA8+
To support the example scenario of stock and urgent orders, you can create two Order Types. Stock orders have regular pricing, and urgent orders incur a surcharge.
For orders created using the Add Order or Create New Order buttons, buyers can choose the Order Type. This updates the product page with the correct prices linked to that Order Type, if any.
Creating an Order Type¶
If only one Order Type exists, it’s assigned to a new order automatically. For Products added to the cart directly, the Order Type with the lower Order number takes precedence over the others. You can always change the Order number in the Order Type to set the default to what you want.
Open the Global Menu () and click on Commerce → Order Types.
Click the Add button(), and enter the following information.
Description: Order Type for all regular orders
This creates the new Order Type and opens a configuration page. The Order field determines the sorting order of the Order Type in the drop down menu. Set the value for the Order field to 0 for the Stock Order Type. Create one more Order Type with the following information.
Description: Order type for urgent orders that is subject to a 10% surcharge
Set the value for the Order to 1 for this Order Type. You can use the Active toggle to enable it. Under the Eligibility tab, you can link the Order Type to a specific Channel or all Channels.