News:

Looking for documentation? Take a look on our wiki

Main Menu

UK Shipping postcodes

Started by Lumini, October 09, 2014, 19:38:19 PM

Previous topic - Next topic

Lumini

Hi can anyone help:

I need on advice the best way to do this in Virtuemart or a plugin I can install.
I need to... in the shipping methods be able to create different prices for different post codes with the UK and islands around UK. What would be the best way to do this?

e.g.
•UK mainland free delivery on orders over £30.00 order less than £30.00 = £4.00 - (this is obviously easy to set up in the standard shipping configuration)
•Ireland, Scottish islands and Europe - £15.00 (this not so easy any ideas? as Scotland is part of UK and can't be separated out in to mainland and islands)

Any help would me most grateful
Thanks

AH

Once you ahve your required shipping plugin

GJC appears to have this sorted for you  and he is very active in the VM community so should get great support!

http://www.gjcwebdesign.com/joomla-downloads/virtuemart-20-postcode-zip-code-shipping-plugin.html

I use my own shipping modules but it is not a commercial offering

They important thing for all these to work is to ensure that the user enters the Postcode in the correct format

Failure to do so will result in incorrect shipping matches


Core VM2/3 does not validate the postcode format


This can cause problems when customers enter postcodes and get the space in the incorrect position or use (zero)0 in place of O
e.g.

   // Isle of Wight
      'PO31', 'PO32', 'PO33', 'PO34', 'PO35', 'PO36', 'PO37', 'PO38', 'PO39', 'PO40', 'PO41',

   
Take a look at the postcode areas for Portsmouth and you will see that getting the space in the incorrect postion can and will cause postcode/shipping zone matching errors.

http://en.wikipedia.org/wiki/PO_postcode_area

So you can/ should apply some logic to entry of UK addresses and their postcodes in the user-address fields



Regards
A

Joomla 4.4.5
php 8.1

reinhold

Alternatively, my "Advanced Shipping by Rules" plugin provides several ways to handle UK postcodes:
http://open-tools.net/virtuemart-2-extensions/vm2-advanced-shipping-by-rules-plugin.html

See the documentation (section "Supporting alphanumeric postal codes"):
http://open-tools.net/documentation/shipping-by-rules-plugins-for-virtuemart.html#alphanumeric_postcodes

In particular, you have the following five variables available for your rules:

  • UK_Outward: The Outward part of the postal code (the two to five characters before the space)
  • UK_Area:   The postal area (one or two letter)
  • UK_District:   The postal district within the postal area (one or two digits)
  • UK_Subdistrict:   The subdivision of some central London districts (a letter, or empty)
  • UK_Inward: The Inward part of the postal code (the three characters after the space)

Best regards,
Reinhold

AH

However - you still have to ensure that the customer puts a space in the correct poisition and uses this correct format

They will do the following:-

Replace O with 0  and vice versa
Put a space in the wrong place
Leave out the space

If reinholds shipping can sort this out, then it looks like a good fit for you as well (sorry to have left you out - no favouritism intended!)

He is also very active in the VM community.

However
QuoteUK_Outward: The Outward part of the postal code (the two to five characters before the space)

There are Never 5 characters before the space so not sure what it is doing using 5?

Postcode format

Outward = no more than 4 characters
Inward = no more than 3



[attachment cleanup by admin]
Regards
A

Joomla 4.4.5
php 8.1

reinhold

You are right, the outward part has only have four characters maximum (only single-digit districts were subdivided, but no double-digit districts like EC50, SW10-SW20, SW90, etc). However, that does not matter for my plugin anyway. After uppercasing it, the postal code is matched with the RegExp:
^\s*(([A-Z]{1,2})(\d{1,2})([A-Z]?)|[A-Z]{4})\s*(\d[A-Z]{2})\s*$

So, leaving out the space will still work with my plugin. However, misplacing the space or using the letter O instead of the zero will still break the UK postal code detection.

Best regards,
Reinhold

AH

Great fast response reinhold.

It is the VM userfield for zip that requires a validation of format when the customer is in the UK

I would not expect this to form part of your shipping functionality.

It requires a custom template overrride to the address input in order to test and prevent incorrect format.
Regards
A

Joomla 4.4.5
php 8.1