Domanda

The task is just like the title says: implement in PHP a feature that dynamically sets the delivery cost according to given postcode for United Kingdom. It would be a part of an e-commerce application (precisely: prestashop). It should work more or less like on this page.

My question is: is there any tool I can use? The only thing I've found is a one-table "database" (basically to be downloaded in CSV). But there are 2 problems:

  • I'm missing relation between a small-scale region (like Aberdeen) and a big-scale region/county/country (like Scotland). I don't consider doing it manually - possibly there's something that could help.
  • However, as wikipedia says, Royal Mail has given some special postcodes that are not related to regions but to organisations. Therefore I can't be 100% sure that above CSV will cover all possible postcodes that a customer could submit.

Do you know any tool or webservice or whatever else that deals with such functionalities?

È stato utile?

Soluzione

Why not use a postcode database from an official source, such as Ordnance Survey's CodePoint Open - ordnancesurvey.co.uk/oswebsite/products/code-point-open - which is also free, and updated four times a year.

CodePoint Open doesn't include the 'specials', because they're not geographically tide (so the valid "SAN TA1" postcode isn't included), but do you really expect to be delivering to the headquarters of the FA or any of those "own postcode" organisations? If you do need those, then you can always add them manually.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top