Page 1 of 1
Postcodes to control zones.
Posted: Mon Jan 04, 2010 1:42 pm
by robgrigg
Hi,
I want to use the zones to differenciate postcodes for shipping in the UK.
I have all of the post code rules but they are a little complicated. For example, the Scotish Highlands can have the codes beginning IV1*-IV28*, IV33*-IV39* but not IV29*, IV30*,IV31,IV32.
My questions. Is there an order to the includes vs. the excludes? I.E if I include IV* and exclude IV29*, IV30*,IV31,IV32, will that select all of the IV1* to IV99* but NOT the excluded ones?
Also, is there an order to the zones. So for instance can I add a zone at the end to catch all of the ones which fall through.
This will take some time to implement and test to if the current solution is not up for it then I'd rather know know and if it is, then any advice would be greatly appreciated.
Regards,
Rob.
Re: Postcodes to control zones.
Posted: Tue Jan 05, 2010 3:54 am
by Uzair
My questions. Is there an order to the includes vs. the excludes? I.E if I include IV* and exclude IV29*, IV30*,IV31,IV32, will that select all of the IV1* to IV99* but NOT the excluded ones?
Yes it'll work exactly the way you described. I'm not familiar with UK address. One of zones at my test store is configured as
Selected Province(s): New Jersey
Postal Code(s): 08*
Exclude Postal Code(s): 082*
This zone is applicable on all the zip codes that start with 08 but excluding those starting with 08
2 i.e 0820-08270
Also, is there an order to the zones. So for instance can I add a zone at the end to catch all of the ones which fall through.
Can you explain it more please? I couldn't understand.
Re: Postcodes to control zones.
Posted: Tue Jan 05, 2010 7:02 am
by robgrigg
Thanks Uzair, thats great news.
On the last note, to explain further, there are about 1.7 M posrcodes in the UK. If I look at the regions i want to treat differently then I get to about 200 post codes.
so my plan is to setup a zone for each of the smaller regions which the shipping costs are greater, for example the Channel islands, the outer reaches of scotland.
Id then like to have a zone which is a catch all, so that any postcodes which do not all into ant of the restricted zones fall into the default one. I would set it up to include all (?). Can I do this (will it work) and if so, is the order of the zones on the screen relevant?
Does this make more sense?
Rob.
Re: Postcodes to control zones.
Posted: Tue Jan 05, 2010 8:25 am
by robgrigg
I have a further question.
the postcodes in the uk are in the format XXn(n) nXX. Where x is a character, n is a number and (n) is optional for numbers bellow 10.
For example. TN1 1AB which can also be written as TN11AB.
one can also have the postcode TN11 1ab, which caould be written TN111AB.
let's say I want to include all poscodes starting TN1 with the 3 letter suffix (TN1 nxx), but not TN11 xxx)
I can't exclude TN11* because i would exclude TN11AB (or TN1 1AB as written correctly).
The only way I can see around this (unless you can come up with another answer, is to use the space and inforce the space is added in the postcode by using a regex.
So a question and a plea. the question is, will the software respect the space (if i do TN1 * to include and TN11 * to exclude)???
The plea; can you find use your much bigger brains to come up with a better answer?
Cheers!
Rob.
Re: Postcodes to control zones.
Posted: Wed Jan 06, 2010 11:47 am
by robgrigg
Update.
I ahve got this working using the regex option in the zones.
I have created the following zones;
Scotish highlands
Scotish Islands
Northern Island
Channel Islands
etc.
Each of these has an inclusive regilar expression based on the poscode in that area.
I have then combined all of these into one large RegEx and created a Mainland UK zone with the concatinated Regex in the Exclude filter.
This work a treat, I did have to extend the fiels size for the ac_ShipZones comumns using
Code: Select all
ALTER TABLE ac_ShipZones ALTER COLUMN PostalCodeFilter nvarchar(1000) NULL
ALTER TABLE ac_ShipZones ALTER COLUMN ExcludePostalCodeFilter nvarchar(1000) NULL
The regular expression i used are;
Code: Select all
all
((([gG]|[jJ])[eE][0-9a-zA-Z]+)|([iI][mM][0-9a-zA-Z]+)|([pP][oO](3[0-9]|40|41)\s?[0-9][a-zA-Z]{2,2})|([tT][rR]21\s?[0-9][a-zA-Z]{2,2})|([bB][tT][0-9a-zA-Z]+)|([fF][kK](17|18|19|2\d|3\d|4\d|5\d|6\d|7\d|8\d|9\d)\s?[0-9][a-zA-Z]{2,2})|([iI][vV](1\d|20|21|22|23|24|25|26|27|28|33|34|35|36|37|38|39|52|53|54|63))|([pP][aA](21|22|23|24|25|26|27|28|29|3\d|40))|([pP][hH](18|19|20|21|22|23|24|25|26|3\d|40|41|49|50))|([gG]83)|([kK][wW](\d|10|11|12|13|14)\s?[0-9][a-zA-Z]{2,2})|([hH][sS][0-9][a-zA-Z]?\s?[0-9][a-zA-Z]{2,2})|([iI][vV](4\d|50|51|55|56))|([kK][aA](27|28))|([kK][wW](15|16|17))|([pP][aA](20|41|42|43|44|45|46|47|48|49|6\d|70|71|72|73|74|75|76|77|78))|([pP][hH](42|43|44))|([zZ][eE](1|2|3)[a-zA-Z]?\s?[0-9][a-zA-Z]{2,2}))
Gernsey
([gG]|[jJ])[eE][0-9a-zA-Z]+
Isle Man
[iI][mM][0-9a-zA-Z]+
Isle White
[pP][oO](3[0-9]|40|41)\s?[0-9][a-zA-Z]{2,2}
Scilly
[tT][rR]21\s?[0-9][a-zA-Z]{2,2}
Northern Island
[bB][tT][0-9a-zA-Z]+
Scottish Highlands
[fF][kK](17|18|19|2\d|3\d|4\d|5\d|6\d|7\d|8\d|9\d)\s?[0-9][a-zA-Z]{2,2}
[iI][vV](1\d|20|21|22|23|24|25|26|27|28|33|34|35|36|37|38|39|52|53|54|63)
[pP][aA](21|22|23|24|25|26|27|28|29|3\d|40)
[pP][hH](18|19|20|21|22|23|24|25|26|3\d|40|41|49|50)
[gG]83
[kK][wW](\d[a-zA-Z]?|10|11|12|13|14)\s?[0-9][a-zA-Z]{2,2}
Scottish Highlands all
(([fF][kK](17|18|19|2\d|3\d|4\d|5\d|6\d|7\d|8\d|9\d)\s?[0-9][a-zA-Z]{2,2})|([iI][vV](1\d|20|21|22|23|24|25|26|27|28|33|34|35|36|37|38|39|52|53|54|63))|([pP][aA](21|22|23|24|25|26|27|28|29|3\d|40))|([pP][hH](18|19|20|21|22|23|24|25|26|3\d|40|41|49|50))|([gG]83)|([kK][wW](\d[a-zA-Z]?|10|11|12|13|14)\s?[0-9][a-zA-Z]{2,2}))
Scottish Islands
[hH][sS][0-9][a-zA-Z]?\s?[0-9][a-zA-Z]{2,2}
[iI][vV](4\d|50|51|55|56)
[kK][aA](27|28)
[kK][wW](15|16|17)
[pP][aA](20|41|42|43|44|45|46|47|48|49|6\d|70|71|72|73|74|75|76|77|78)
[pP][hH](42|43|44)
[zZ][eE](1|2|3)[a-zA-Z]?\s?[0-9][a-zA-Z]{2,2}
Scottish Islands All
(([hH][sS][0-9][a-zA-Z]?\s?[0-9][a-zA-Z]{2,2})|([iI][vV](4\d|50|51|55|56))|([kK][aA](27|28))|([kK][wW](15|16|17))|([pP][aA](20|41|42|43|44|45|46|47|48|49|6\d|70|71|72|73|74|75|76|77|78))|([pP][hH](42|43|44))|([zZ][eE](1|2|3)[a-zA-Z]?\s?[0-9][a-zA-Z]{2,2}))
hope this helps someone.
Rob.
Re: Postcodes to control zones.
Posted: Mon Mar 15, 2010 11:21 am
by ThinkNoodle
Hi Rob,
I need to do this too, do you think extending the fields size for the ac_ShipZones columns will cause problems with future updates?
Cheers
Matt