Condition lists make it easy to import large amounts of data like postcodes to use in your Checkout conditions. The nShift Checkout interface also allows you to export your condition lists, making it easy to edit your data when needed.
This article will explain how to:
- Create conditions lists
- Upload and activate a condition list
- Export a condition list
- Use condition lists in the rule engine
Create condition lists
Condition lists are created in .txt format and must comply with the following rules:
- Ranges and items must be entered in separate rows.
- Use semicolon (;) between values to indicate a range.
- Date (YYYY-MM-DD)
- DateTime (YYYY-MM-DD HH:mm)
- Time (HH:MM)
- Use dot (.) as decimal separator
There are three ways to add data to your lists:
One value per row:
11145
11175
11190
Interval per row:
11130;11140
41130;41140
Look up:
1=10
2=20
3=25
4;7=30
Example showing postcode ranges as well as single postcodes:
11130;11140
11145
11160;11170
11175
11180;11190
41130;41140
41145
41160;41170
41175
41180;41190
Upload and activate a condition list
Once you have created a condition list in .txt format, you need to upload it.
- Go to Condition lists in the top menu and click the Upload button.
- Select or drag and drop a file and select member account and content type. The list name is the name that is visible in the interface. Example below.
- Click the Import button. You will get a confirmation on the screen if the file is successfully imported.
- To activate the list, click the Inactive icon and confirm. The icon will switch to Active. Click any time again to deactivate a list.
Export a condition list
You can export a condition list if you wish to verify the data or modify it for re-upload.
- Go to Condition lists in the top menu and locate the list you want to export.
- Click the three-dot menu and choose Export.
- Upon successful download, a confirmation message will appear on the screen. The file will be saved in your Downloads folder.
Use condition lists in the Rule engine
Condition lists make it easier to manage large data sets in rules and it is easier to update a list of postcodes rather than updating a larger number of rules.
Using values from condition lists in Conditions requires switching to Advanced mode. In the example below, we are making a condition that uses postcodes in a condition list named "Postcodes".
Condition lists can also be used in Actions. In the example below, we want to set the price of Home Delivery depending on zones defined in a condition list.
toNumber is the function that looks up the parameter aNumber in the zones condition list.
Before creating the rule, the parameter must be defined as a custom parameter under Parameters and the Type should be set to Integer number:
The condition list must be of the type Integer Number.
Example showing a condition list with zones:
1=2
2=3
3=4
4;5=5
Zone 1 costs 2 EUR, Zone 2 costs 3 EUR, etc.
Use cases
See our use case articles for step-by-step tutorials on how to use condition lists: