In this use case, we will illustrate how to use a condition list to look up prices. Our Pallet delivery option is priced according to the number of pallets and becomes cheaper the more pallets you ship. We will create a condition list with price steps, a custom parameter, and a rule that calculates the price based on a look-up and the number of pallets.
Learn how to:
Note: This tutorial assumes that a Checkout configuration has already been created.
Create and upload the condition list
- Start by creating a condition list. (See the Condition lists article for more information on formatting).
Example :1=500
2;3=475
4;6=450
7;10=390
11;25=275(1 pallet costs 500 SEK, 2-3 pallets costs 475 SEK per pallet, 4-6 pallets costs 450 SEK per pallet, etc.)
- Log into Checkout and go to Condition lists in the top menu.
- Click Upload.
- Select the condition list created in step 1.
- Choose a member account.
- Set the content type to Integer Number and name the list.
- Click Import.
Example:
- The condition list is created and inactive. Click the Inactive icon to activate it.
Create a rule in the rule engine
We want to create a rule that uses the condition list to look up a price and multiplies this with the number of pallets. A custom parameter is needed to make the lookup.
- Open the Checkout configuration where the condition list should be applied.
- Start by creating a custom parameter by going to Parameters and clicking Add parameter.
- Name the custom parameter and select Integer number under Type.
- Click OK to save the parameter.
- Go to the Rule engine section and click Add new rule.
- Enter a name for the rule.
- The pallet prices only apply to Sweden so start by making a condition saying to_country is equal to Sweden.
- Under Action choose Set price and choose the Pallet delivery option.
- In the currency field, write:
toNumber(palletquantity from "PalletPrices")*palletquantity
- toNumber is a function
- palletquantity is the custom parameter created in step 2
- PalletPrices is the condition list
- Click Continue and click Save.
- Use the test tool to verify that it works as intended.
Rule configuration:
Test with two pallets. The price is calculated based on the price in the condition list: 2 * 475 = 950 SEK:
Test with 10 pallets. The price is calculated based on the price in the condition list: 10 * 390 = 3900 SEK: