Postcode prefixes in zones
A zone has two fields: a list of countries, and a list of postcode prefixes. Scenarios then refer to the zone by name, so the same geography can drive a remote-area surcharge, a free-shipping rule and a hidden express option at once.
The prefix field is the one that causes confusion, because it does not hold full postcodes.
Prefixes match the start of the postcode
Each entry is compared against the beginning of the customer's postcode. You decide how wide it reaches by how many characters you type.
| Entry | Matches |
|---|---|
| 94 | 94000, 94110, 94230, 94999, and anything else starting with 94 |
| 9411 | 94110 through 94119 |
| 94110 | 94110 only |
| SW | SW1, SW1A, SW19 |
Case and spaces do not matter. "sw1 a" and "SW1A" are stored and matched the same way.
When a zone matches
Two checks, both have to pass:
- The destination country is in the zone's country list. An empty list accepts every country.
- The destination postcode starts with one of the prefixes. An empty prefix list accepts the whole country.
Since the country check runs as well, the prefix 94 in a Thailand zone will not pick up a French address in 94200.
Shortening a long list
Carriers usually send remote-area coverage as raw codes. A Thai example, 32 of them:
94000, 94110, 94120, 94130, 94140, 94150, 94160, 94170, 94180, 94190,
94220, 94230, 95000, 95110, 95120, 95130, 95140, 95150, 95160, 95170,
96000, 96110, 96120, 96130, 96140, 96150, 96160, 96170, 96180, 96190,
96210, 96220
Every one of them starts with 94, 95 or 96, so the zone needs three entries:
94
95
96
This also covers codes the post office adds later, which the 32-line version would miss.
How short to go depends on what you actually ship to:
| Intention | Entry |
|---|---|
| The whole 94, 95 and 96 range | 94, 95, 96 |
| Only 50260 to 50269 | 5026 |
| A single postcode | 50260 |
| Every UK postcode in SW or EC | SW, EC |
A two-character entry is wide: 50 takes in everything from 50000 to 59999. If you only need a few districts of a province, write the four-character form.
The 50-prefix limit
A store can hold 50 postcode prefixes in total across all of its zones. The line under the prefix box keeps count ("12 of 50 prefixes used across all zones"), and a save that would go over is refused with a message.
The limit rarely bites once entries are prefixes rather than full codes. The example above needs 3 of the 50.
Zones created before the limit
Older zones can be longer than 50. The Zones page then shows an amber notice, and only the first 50 prefixes are used at checkout, so some addresses in those zones stop being recognised.
Bringing the count down:
- Open Zones and start with the longest lists.
- Replace each run of codes with the prefix they share.
- Remove codes you no longer ship to, and zones nothing refers to.
- Save. The notice clears once the total is 50 or less.
What happens when you save
Three things are cleaned up:
- duplicates are dropped;
- an entry that a shorter entry in the same zone already covers is dropped, so 94 and 94110 together leave just 94;
- spaces are removed and letters are upper-cased.
No address that matched before the cleanup stops matching after it.
Checking your work
Open a scenario that uses the zone and press Test. Enter the postcode you are unsure about and see whether the scenario matches. That is faster than placing a test order, and it reads the same zone data checkout does.
Common questions
Do prefixes have to be numeric? No. SW, EC1, V6B and 1000 all work. Whatever the postcode starts with.
Can I match something in the middle of a postcode? No, matching starts at the first character.
What about addresses without a postcode? They match only when the zone has no prefixes at all, where the country decides on its own.
We need more than 50 individual codes. Send the list to hello@lisive.com. Most lists collapse into a few prefixes, and we can do that with you.