UK Postcode Parsing and Range Checking

  • Posts: 131
  • Thank you received: 7
8 years 8 months ago #232236

Need to restrict a shipping method using a UK postcode range?

I just wanted to thoroughly recommend Brainforge's Manual Shipping Plugin.

I came to the conclusion that the standard Hikashop Manual Shipping Plugin will not work if you want to restrict the method to the first part of a UK postcode as it takes the whole number after the prefix as the min and max range, it's because of the way that UK postcodes are structured

For example: SP119FG - there's no way to split away the SP11 away from the rest of the postcode string.
Using simply SP11 as the prefix with no min and max doesn't work.

So, fortunately, I came across Jonathan's work here:- brainforge.co.uk/downloads/hikashop-deli.../3-brainforge-manual

It has a specific UK postcode parser which works beautifully, and in fact, will even accept a PCRE regex for complex, multi postcode range checking.

It works beautifully, thanks, Jonathan.

[NOTE] One minor gotcha is that when you install the plugin you will need to enable the Postcode Format to UK Special in the plugin Optional Features.

Last edit: 8 years 8 months ago by bonzomedia.

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum