Forums / Built-in Shipping and Payment Modules / UK Shipping by postcode

UK Shipping by postcode

Locked

Started by schoolboy on 8 Mar 2007, 9:51 PM · Views: 10,715

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
8 Mar 2007, 9:51 PM
#1
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

UK Shipping by postcode

To all UK zencart stores !!!

I am looking at initiating a project to develop a sophisticated shipping module that calculates shipping by postcode.

I know this has been discussed before... and that Ryk has been active in getting something like this off the ground, but what I'm thinking of is far more extensive.

Heres the outline:-

UK Postcodes comprise TWO elements:

  1. The OUTBOUND CODE
  2. The INBOUND CODE

eg: CB1 10RE

CB1 is the OUTBOUND part of the code
10RE is the INBOUND part of the code

These postcodes can be GEO-MAPPED, meaning that if we know the postcode of the WAREHOUSE (or shop distribution point), we can calculate the distance to the customer's postcode.

Now, to base a module on the WHOLE postcode (while possible) will require a significant level of input, to base it on just the OUTBOUND part is a little less complex.

My vision is this:-

The shop's location is identified by its postcode.

This set's the "bullseye" for the shipping calculations.

Through the geo-mapping, the module configures five or six shipping zones:-

eg:

  1. 10km from shop
  2. 20km from shop
  3. 50km from shop
  4. 100km from shop
  5. 200km from shop
  6. more than 200km from shop

The geo-mapping can work out exactly what postcodes fall into each of these 6 zones - RELATIVE to the shop's postcode.

When a UK customer signs up, he/she gives us their postcode.

The shipping module looks at whether the customer is UK.

If TRUE, module is ACTIVE.

Shipping module looks at OUTWARD portion of customer's postcode.

Algorithm calculates and determines ZONE, based on Postcode of shop.

Shopkeeper can determine RATES for each zone, depending on personal preferences and bespoke shipping policy.


THIS CAN WORK !!!

Take a look at the following example of how geo-mapping works (based on the relationship between POSTCODE ONE and POSTCODE TWO:-

http://www.homeworkerzone.co.uk/home/hwz/search/search.guest.php?accessdenied=%2Fhome%2Fhwz%2Fsearch%2Fsearch.member.php

We just need to port this concept across to zencart and we will have the ability for UK zenshops to calculate shipping using the customer's postcode.


If anyone else is interested in this concept, add to this thread, and let's see if we can find someone to build this for us.

20 years a Zencart User

8 Mar 2007, 9:57 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,732
Plugin Contributions:
0

Re: UK Shipping by postcode

If you are going to make such a module - why not make it flexible enough for the rest of the world to use too?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

8 Mar 2007, 10:36 PM
#3
jollyjim avatar

jollyjim

Totally Zenned

Join Date:
May 2005
Location:
Cheshire, UK
Posts:
401
Plugin Contributions:
2

Re: UK Shipping by postcode

@schoolboy

Whilst I agree this would certainly be a useful feature, be mindful the UK postal system is based on weight and size of package, not based on distance within the UK. So there is not really any added advantage creating this module to be solely UK aside from the obvious "neat and flashy" sleight of hand.

As far as I am aware, couriers also base their deliveries on weight not on distance travelled.

All this said however, developing one for the UK as a base starting point will have its practical uses. Firstly, once it works within the UK, it should be relatively straightforward to hook it into a pan-european system. This is where it would prove most valuable. From the GEO base in the UK you would be able to instantly quote accurate postage based both on weight and distance - all from the postcode of the store (or one entered by the customer).

The biggest issue would be where to get the accurate postcode data both for the UK and each country in Europe. You would then need to hook into individual carriers and work up a matrix of prices for each carrier based both on weight, distance and destination country.

In my opinion this is a lot of work but if you put it together as a European Geo solution I think it would be invaluable to every single zencart user. You would be extending the shipping capabilities of zencart 1000%.

If you do decide to do this I suggest starting with one country (UK) then extend from there. I also suggest you build in a tracking system per parcel where the user can enter the package number and track the parcel. This should be available to admin and also to the account owner in My Account. Provided you worked with individual carriers in the UK the same model will work for each country with minor alterations only needed to take into account the differences between each carrier's systems.

I hope this gives you something to work from and please do keep me updated on progress. I think it is a great idea.

8 Mar 2007, 10:57 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: UK Shipping by postcode

There is no reason why:-

A. it can't be "adaptable" to other regions in the world where postcodes interface with geo-mapping.

B. it incorprates a component that factors weight into the equation.

UK Postal charges are notoriously complex (Royal Mail), but we have recently conducted negotiations with several (8 actually) private couriers, who calculate their rate principally on DISTANCE.

As we all know... shipping calculation remains one of the most hair-pulling aspects of modern catalogue-based commerce.

Short of praying for a solution from above, I think a concerted effort to look at how we can amalgamate the core variables in shipping:-

Volume
Weight
Distance
Value

into a functional, customizable module. we'll be addressing some of the most pressing concerns of e-shop owners world wide.

Zen Cart - leaders in e-commerce would significantly enhance their (already gilt-edged) reputation if they could get their heads around effective shipping configuration...

There must be hundreds of zen cart users with appropriate technical ability to get this in motion. By working in collaboration with the core team (and all users helping to fund it) we could nail shipping issues down once and for all...

20 years a Zencart User

8 Mar 2007, 11:50 PM
#5
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: UK Shipping by postcode

There are over 2500 OUTBOUND postcodes for the UK - full list available here.

And you want to calculate the distance of each one from your dispatch location?

I take it you've discovered the secret of eternal life? :laugh:

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

9 Mar 2007, 8:34 AM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: UK Shipping by postcode

Ryk:

There are over 2500 OUTBOUND postcodes for the UK - full list available here.

And you want to calculate the distance of each one from your dispatch location?

I take it you've discovered the secret of eternal life? :laugh:

Hello Rick!

Eternal life is an easier secret than this, I'm sure! I'm currently looking at a php code that successfully does the mapping calculation off the outbound postcode.

The dbase contains the outbound code and the latitude and longditude co-ordinates. Using cartesian principals, the algorithm looks at the two postcodes' latitude and longditude co-ordinates, then calculates distance. (it's "as the crow flies", but that's good enough for me).

What I now need to do (or get a much more clever lady or gent to do) is work out how we parse the result of that calculation into a shipping option...

20 years a Zencart User

9 Mar 2007, 9:21 AM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: UK Shipping by postcode

To see how this geomapping works using a core postcode, then calculating distance to relative postcodes:

go **HERE**

Enter ANY UK outward postcode...

Now, I have the PHP code instructions that make this stuff work, and I have the postcodes geo-co-ordinates file.

I can PM these to interested programmers, but they are subject to COPYRIGHT.

20 years a Zencart User

9 Mar 2007, 9:47 AM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: UK Shipping by postcode

...And here's another link:

Click **HERE**

20 years a Zencart User

9 Mar 2007, 10:50 AM
#9
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: UK Shipping by postcode

Hi,

schoolboy:

I am looking at initiating a project to develop a sophisticated shipping module that calculates shipping by postcode.

We have developed a basic table rate shipping module which allows setting of differing prices for anywhere in the UK based on the outbound part of the destination postcode.

It works just like the normal table rates module, i.e. the rates are based on price or weight falling within specific ranges.

It isn't geomapped but it may be a useful stop gap solution for you as it allows setting specific outbound ranges to be accepted or denied for a particular table of rates.

The more tables of rates (zones) you set up the more specific you can be about what the prices for a particular country/postcode combination are...

E.g.

Having

"GB:BT1-10,GB:BT24-27" for the first zone and

"GB" for the second zone

will mean that a customer at BT100JX will have the first zone's table rates applied whereas a customer at BT134JF will have the table rates of the second zone applied (GB is basically a catchall/fallover for the UK in this case).

The module also works with Portugese, Spanish and French postcodes (E.g. FR:21-23 covers part of Corsica 21000 - 23000).

It will take some time to bring this module to release status so yesterday I made this post about this module.

All the best...

Conor
ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Mar 2007, 11:02 AM
#10
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: UK Shipping by postcode

Hi,

Forgot to mention that the module automatically enables/disables itself based on the customer's postcode so you don't get any "We don't ship to your Country/Postcode" error messages... nasty things! :)

It also allows the defining of specific messages for each zone in the language files. For example, from our client's config:

define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_TITLE_3', 'Flat Rate or FREE!');
define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_WAY_3', 'Free if Order Total Over £50, £2.95 if Under');

define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_TITLE_5', 'Flat Rate');
define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_WAY_5', 'Standard Shipping to Madeira/Azores'); 

These language definitions also use fallbacks (if you don't define definitions for zone 4, as above, the definition for zone 3 is used).

Think this would be a nice module to bring to release status but we'd need a few people to be interested... can't spend a day off work writing something only 1 or 2 people want (unless someone wants to donate)! :blink:

All the best...

Conor

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Mar 2007, 12:14 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: UK Shipping by postcode

conor:

Hi,

Forgot to mention that the module automatically enables/disables itself based on the customer's postcode so you don't get any "We don't ship to your Country/Postcode" error messages... nasty things! :)

It also allows the defining of specific messages for each zone in the language files. For example, from our client's config:

define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_TITLE_3', 'Flat Rate or FREE!');
define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_WAY_3', 'Free if Order Total Over £50, £2.95 if Under');

define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_TITLE_5', 'Flat Rate');
define('MODULE_COUNTRY_POSTCODE_TABLE_TEXT_WAY_5', 'Standard Shipping to Madeira/Azores');

> 
> These language definitions also use fallbacks (if you don't define definitions for zone 4, as above, the definition for zone 3 is used).
> 
> Think this would be a nice module to bring to release status but we'd need a few people to be interested... can't spend a day off work writing something only 1 or 2 people want (unless someone wants to donate)! :blink: 
> 
> All the best...
> 
> Conor

Hello Conor


I use your C.Card module on some sites, so if anyone can tackle this shipping thing, I'll bet it's YOU !!!


Thanks so much for the input, and yes... I think we need to see who / how many UK zen users would like something like this.

The geomapping, I believe, is fundamental to it...

Then... if we could build in some feature that also allows shop owners to factor in a volumetric weight component (over and above the geomapping function), I think we're on our way:

The store owner should also have options to do the following:-

1. Configure as many "distance zones" as they need (up to a maximum of ten, possibly) The input screen would say something like:

 - How many zones do you want to set up, and what is each zone's radius from the shop?


2. Shop owner then applies a cost to each zone:

 - Zone 1 = £5.00 ; Zone 2 = £10.00 ; Zone 3 = £15.00  (etc)

3. Then, an OPTION to include a weight/volume surcharge to each zone. (Zencart can already record item weight, and totals these up in the shopping cart.)

 - Zone 1 weight/volume surcharge = £1.50 / kilogram ; Zone 2 weight/volume surcharge = £1.25 ; (etc)

----------------------------------------

I'll undertake to commit £100 to the project to start with - anyone else out there prepared to do the same???

-----------------------------------------

20 years a Zencart User

22 Mar 2007, 8:19 PM
#12
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: UK Shipping by postcode

Hi,

Apologies for the delay in getting back to you, I was having a good think about what should be done about this. (Actually, I'd written most of this two weeks ago but we got busy... where does the time go? ;) )...

Since it's quite an advanced module I was thinking about including the package tracking features suggested by JollyJim. Then I started thinking about completely rewriting the Zen Cart shipping class to allow the reuse of shipping modules each with its own configuration (for Next Day Express Delivery as an extra option etc.). I've finally come round to deciding that that's too much to take on right now (purely in terms of time, none of it would be hard to code) and that getting the following going would be a good enough module to be useful for the moment...

The module can define an unlimited number of Zones to be shipped to. (The number is adjusted through the admin and extra Zones added dynamically, no hacking of variables within files is required; I've got this code working already [in the only way Zen Cart will allow]).

Each Zone works like the "Table Rate" module... i.e. you can define various Ranges for each Zone, with each Range having an individual Shipping Price.

The module would have a two step process in determining what Shipping Price should be applied to the current order:

  1. First off, the module determines which Zone the user is in by looking at their ISO Country Code, then the Outbound portion of their postcode (for UK), or initial digits of their postcode (for France, Portugal, Italy etc.).

Each Zone you have defined in the Admin is checked in numerical order to see if it matches the customer's Country Code/Postcode.

Two methods can be used to determine if the customer's Country Code/Postcode match...

  • If the current Zone being examined is set up to use Geolocation Matching then a method for determining the distance from the shop by comparing the shop's postcode to the customer's Country Code/Postcode is called if it exists. E.g. if your shop is in the UK and the customer's Country Code is FR and their postcode is 20030 then the following method will be called if it exists: $this->getDistanceGBFR('20030'). The distance is then checked against the table of distances defined for this zone. If it matches one, this zone is used for the shipping calculation.
  • If the current Zone being examined is set up to use Postcode Range Matching then the customer's Postcode is simply compared against the ranges defined for this zone, again if a method for checking the range for the customer's Country Code exists. E.g. For the UK you might set up some ranges as follows:

GB:BT1-10,GB:BT24-27

Then, if the customer's Postcode is BT124FG the method $this->matchesARangeGB('BT124FG', 'GB:BT1-10,GB:BT24-27') is called. If the customer's Postcode matches one of the ranges passed this zone is used for the shipping calculation.

(Negation modifiers can also be used for Postcode Range Matching.. !GB:BT13 would exclude UK postcodes in the BT13 region from the current zone).
2. Once a (the first) matching Zone has been identified, the Ranges for that Zone are used according the mode of operation for the module.

The module would be able to select a particular Shipping Price to use based on Weight or Price in exactly the same way the Table Rate module works (You had mentioned volumes... how were you thinking volume would be tracked? An extra field in the product form?).

I think that's a reasonably flexible system which should provide many advantages to shop owners. It could be so much better but, as I said, it will do for the minute, I don't have time to rewrite Zen Cart's shipping right now.

Don't forget that this module uses a "match or move on" policy... you could end off your module configuration with the last few zones just being overall country code matches: FR, IE etc. with either a table of rates for each or just an individual price (just like every other zone). This would allow you to be very specific price-wise locally then much less specific globally.

Last thing... the module would of course disable/enable itself based on whether or not the customer's Country Code/Postcode combination matches any of the defined zones.

Looking forward to your thoughts on this... hopefully I'm clear enough in what I'm trying to convey above. Also, hopefully a few more people are interested... if so please let me know... it would really raise my priority on getting this going if I knew more people really wanted it (or wanted to contribute towards developing it ;) ).

All the best...

Conor
ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

22 Mar 2007, 8:30 PM
#13
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: UK Shipping by postcode

Conor

This sounds like a very good start. I would use this, and as stated earlier, will contribute £100 to your efforts.

20 years a Zencart User

22 Mar 2007, 8:40 PM
#14
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: UK Shipping by postcode

Hi schoolboy,

Thanks for the feedback... and for the offer, it would make a great start! :thumbsup:

Hopefully over the next few days we can get more feedback on whether people think this will be able do the job for them and then I can set aside some time to start working on it!

Could you please send me the code for the geolocation for the UK so I can start looking through it? Thanks!

All the best...

Conor

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Mar 2007, 3:13 PM
#15
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: UK Shipping by postcode

Hi,

I've got round to releasing the first version of this module... should hopefully bring a smiles to a few faces here!

Enjoy

All the best...

Conor :thumbsup:

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.