Introduction to Pricing
Liferay provides a robust pricing system to fine-tune product prices. You can define multiple price entries for a single product SKU and determine which accounts, account groups, and channels are eligible to receive each price. If multiple price entities exist for the same SKU, the Commerce pricing engine calculates which entities should be used for each channel customer.
The following overview describes the Commerce Pricing Engine v2.0+. This engine version is the default algorithm used for Commerce 3.0+ and Portal/DXP 7.3+. Commerce 2.1.x and earlier versions use Commerce’s Pricing Engine v1.0 by default. If desired, you can change the Pricing Engine version used for the instance.
Components of Commerce’s Pricing System
In Liferay, every product is stored in a catalog, and each catalog has its own default base price list and base promotion list. These lists are used to store base price entries for all product SKUs contained in the catalog and are made available to all customers. You can also create custom price lists and promotion lists to define more targeted and configurable price entities. As part of each entry, you can also define price tiers that set special prices for products based on quantity. Finally, create discounts that are applied on top of price entries without overriding them.
Base Price List
The base price list stores the starting price entry for every product SKU in a catalog. These entries set the standard currency and price used for each SKU when no overrides are applied to it. This list is automatically created for every catalog and is available to all accounts and channels. See Setting a Product’s Base Price to learn more.
Base Promotion List
The base promotion list stores base promotional price entries for all product SKUs in a catalog. When applied to an SKU, the base promotional price entry overrides its base price for all customers. This list is automatically created for every catalog and is available to all accounts and channels. See Promotion Base List Reference for more information.
Price Lists
Custom price lists store price entries for specific products and are available only to eligible customers. These lists can use a different currency from the base price list and can include all or only some of a catalog’s products. A custom price list entry override an SKU’s base price for eligible customers. You can also define Price Modifiers to modify specific price entries. See Creating a Price List for more information.
Promotion Lists
Custom promotion lists store promotion price entries for specific products and are available only to eligible customers. These lists can use a different currency from the base price list and include all or only some of a catalog’s products. When applied, they override other price entries of an SKU (e.g., base prices, tiered prices) for eligible users. In these lists, you can also define Price Modifiers to modify specific price entries. While active, both the original price and promotional price appear together on the Product page so that buyers see the markdown. See Creating a Promotion for more information.
Prior to Liferay DXP 7.4 U42/GA42, Promotion Price was called Sale Price.
Price Tiers
Price tiers are set directly within a price entry and define specific prices for orders that meet minimum quantity requirements. These prices are displayed to customers as discounted order options. See Using Price Tiers for more information.
Discounts
Discounts are applied on top of the price and modify it without superseding it. They can be defined within an existing price entry, or created as separate entities and used to target products, product groups, categories, shipping costs, subtotals, or totals. See Introduction to Discounts to learn more.
How the Pricing Engine Calculates Product Prices
The pricing engine determines how each pricing component contributes to an SKU’s price in a channel. When the engine receives a price request, it first calculates the product’s unit price and promotion price. These prices are then used to determine the final price made available to the customer.
Calculating an SKU’s Unit Price
When calculating an SKU’s unit price, the pricing engine searches for eligible custom price lists. If multiple lists exist, the engine selects the list with the highest priority. Then, it searches the selected list’s price entries for the product SKU.
If an entry for the SKU exists, the algorithm applies any existing price modifiers to it and uses the total for the SKU’s unit price.
If no entry for the SKU exists, the engine uses the SKU’s base price and applies modifiers from the highest priority price list. The total is the SKU’s unit price.
noteThe engine only searches the highest priority list and does not search for the SKU in lower priority lists. This is to avoid applying prices from different price lists to SKUs in the same catalog.
If no eligible custom price list exists, the engine uses the SKU’s base price list entry for the unit price.
During this process, the engine also checks for applicable tier prices. If one exists, its price is used in place of the default list price for specific quantities.
Calculating an SKU’s Promotion Price
After calculating the SKU’s unit price, the pricing engine calculates the SKU’s promotion price. This calculation is essentially the same as the process for calculating the unit price with two exceptions:
If an applicable promotion list does not have a price entry for the SKU, any existing price modifiers are applied to the unit price, and the total is used for the promotion price.
If there is no applicable promotion list and the base promotion list is set to 0, the promotion price is set to 0.
Calculating an SKU’s Final Price
After calculating the unit and promotion prices, the pricing engine compares them and selects the lower price. The pricing algorithm then searches for all applicable discounts and applies them to that price. The total is the SKU’s final price: the price the customer pays to purchase the product.
How the Pricing Engine Calculates Order Prices
When calculating order prices, the pricing engine first retrieves the shipping costs and applies any discounts that target shipping.
Then, the engine determines the subtotal by adding the final prices of all SKUs in the order. Any discounts targeting the subtotal are then applied.
Finally, the pricing engine adds together the discounted shipping cost and discounted subtotal to get the order’s total. Any discounts targeting the total are then applied.
Pricing Engine v1.0 Reference
Pricing Method | Summary | Overrides the Base Price? | Where is it set? | Applies to who? | Applies to what? |
---|---|---|---|---|---|
Base Price | The base price | n/a | Product SKU | All buyers | Product SKU |
Base Promo | Marked down price | Yes | Product SKU | All buyers | Product SKU |
Price List (List Price, List Promo) | Special pricing (or currencies) per product and buyer | Yes | Price Lists | Selected buyers (Accounts & Account Groups) | Individual Product SKUs |
Tiered Price List (Tiered Price, Tiered Promo) | Special pricing (or currencies) per product and buyer at bulk quantities | Yes | Price Lists | Selected buyers (Accounts & Account Groups) | Individual Product SKUs |
Discount | Modifies price for a group of products or buyers (Can limit quantity and use coupon codes) | No | Discounts | Selected Buyers (Accounts & Account Groups or those who meet certain qualifications) | Groups of Products (or Individual Product SKUs) |
In the Commerce Pricing Engine v1.0, price entries include three components: an SKU, a standard price, and a promotion price. In v2.0, each is a separate entity.
Enabling Pricing Engine v2.0 in Commerce 2.1.x
By default, Commerce 2.1.x and earlier versions use Commerce Pricing Engine v1.0. Follow these steps to enable Commerce Pricing Engine v2.0:
Open the Control Panel, and go to System Settings → Commerce → Pricing.
Click on Commerce Pricing Configuration in the left panel.
Replace
v1.0
withv2.0
in the Pricing Calculation Key field.Click on Save.
Once saved, your instance uses the Pricing Engine v2.0 for all price calculations.