Conditions and parameters
You use parameters to state under which conditions the different delivery options, services and prices are shown in the webshop.
Parameters
Some parameters already exist in the system, but you can also add your own.
Parameters are configured in the UI. If you do not set a default value, the parameter must be set in the API call. Parameters connected to the sender are set automatically.
The following parameters comes with the system.
Notice
Some parameters are mandatory for certain carriers. Please refer to the carrier for further information.
Parameter | Type | Description |
---|---|---|
currency | Text | Currency code |
language | Text | Language code |
fromcountry | Text | Sender country |
tocountry | Text | Receiver country |
fromzipcode | Text | Sender zip code |
tozipcode | Text | Receiver zip code |
tostreet | Text | Receiver address |
fromstreet | Text | Sender address |
tocity | Text | Receiver city |
fromcity | Text | Sender city |
fromstate | Text | Sender state |
tostate | Text | Receiver state |
tosms | Text | Receiver mobile phone number |
toemail | Text | Receiver email address |
weight | Decimal number | Shipment weight Supplied as 0.0 |
minimumparcelweight | Decimal number | Minimum parcel weight for carriers' weight limits Supplied as 0.0 |
maximumparcelweight | Decimal number | Maximum parcel weight for carriers' weight limits Supplied as 0.0 |
cartprice | Decimal number | Total amount in the shopping cart Supplied as 0.0 |
outofstock | Boolean | The item is out of stock. |
readytopackdate | Date | Date when the item is ready to pack Supplied as YYYY-MM-DD |
uselatestlist | Boolean | Activate a condition list on uploading. |
filteragentidlist | Text | Filter for showing own agents Agent ID:s are separated by |. |
Set default value for a parameter
Go to
> .When creating a new delivery checkout you add default values to parameters on the New delivery checkout page.
To add default values to parameters on an existing delivery checkout, click
to the left of the delivery checkout on the Delivery checkout page.
Click
to the left of a parameter.
The parameter appears in the field Name under the parameter list.
Enter a value in the Default field using the Type defined for the parameter.
Click
.
Create and add your own parameters
You can add parameters to a new or existing delivery checkout.
Go to
> .When creating a new delivery checkout you create new parameters on the New delivery checkout page.
To add new parameters on an existing delivery checkout, click
to the left of the delivery checkout on the Delivery checkout page.
In the Parameters section you can enter name, type and default value.
Click
.
You delete the parameter by clicking next to it.
Carrier specific parameters
For some carriers there are parameters that should only be used for their services.
Carrier | Parameter | Type | Description |
---|---|---|---|
helthjem/Svosj | helthjem_active_subscription | Boolean | Gets set to true if there is an active Svosj-subscription with the recipients email. |
helthjem/Svosj | svosj_trial_eligible | Boolean | Gets set to true if the recipient is eligible for a 30 day free Svosj trial account. |
Instabox | instaboxexp_recommendable | Boolean | Gets set to true if there is an Instabox locker closer than x meters from the zipcode of the receiver (where "x" is a number configured by the merchant and Instabox). |
Operators
The following operators are used to state conditions.
Operator | Meaning |
---|---|
> | greater than |
>= | greater than or equal to |
< | less than |
<= | less than or equal to |
= | equal to |
!= | not equal to |
! | not |
& | and |
| | or |
? | list |
Tip
When using only &-operators in an expression, all expressions must be true for the entire expression to be true.
Example:
tocountry = "SE" & fromcountry = "SE"
When using only |-operators in an expression at least one of the expressions must be true for the entire expression to be true.
Example:
tocountry = "SE" | tocountry = "DK" | tocountry = "FI"
Always use excluding conditions in e.g. a price list. Otherwise it's the order that decides.
Example:
cartprice >= 500.0
cartprice < 500.0
Use parentheses to decide in which order expressions should be evaluated to render the expected result.
Example:
weight <=20.0 & tocountry = "SE" | tocountry = "DK"
results in
weight = 40.0 and tocountry=DK is true
weight = 10.0 and tocountry=DK is true
while
weight <=20.0 & (tocountry = "SE" | tocountry = "DK")
results in
weight = 40.0 and tocountry=DK is false
weight = 10.0 and tocountry=DK is true
Instead of creating new parameters or having to write long and complicated expressions you can use ! and != to invert boolean expressions.
Example:
!B2B is true if B2B is false
tocountry != "SE" is true if tocountry is not SE
Use condition lists to evaluate against a large amount of values, e.g. zip codes.
Example:
tozipcode ? "zipcodes_in_gbg_sthlm"
Examples of useful conditions
Example: Price
If the cart contains items for €50 or more the delivery is free of charge.
cartprice >= 500.0
cartprice < 500.0
Example: Weight
This delivery option should only be shown if the weight of the parcel is less than 20 kg.
weight < 20.0
weight >= 20.0
Example: Date range
Delivery is free from Christmas Eve to December 27th.
(date >= "2020-12-24" & date <="2020-12-27")
Example: Own parameters
This delivery is bulky goods sent to a business customer that is not in the partner program.
bulky = true
b2b = true
VIP = false
Example: Titles/headings
Orders made before 1 p.m. are delivered within the day.
time < "13:00"
Condition lists
Condition lists make it easy to import large amounts of data.
Create a list in .txt format with, for example, zip code ranges and/or single zip code items. The ranges and items must be entered on separate rows. Use a semicolon (;) between items to indicate a range.
Example
11130;11140
11145
11160;11170
11175
11180;11190
41130;41140
41145
41160;41170
41175
41180;41190
Upload and activate a condition list
You need to upload and activate the condition list.
Tip
To always activate the condition list immediately when uploading, use the uselatestlist
parameter.
Go to
> .Click
.Click
and select the condition list file.Search for the list to activate it manually. The list has status "OK".
Click
to the left of the list and then . An active list has status "OK (Active)".
You can change the name of the list or delete it, but you can not deactivate it.