Skip to content
Snippets Groups Projects
Commit 7115b603 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

UK Postcodes: Also extract parts of UK postcodes if second part (inbound) is missing altogether

parent 10593a23
Branches
Tags
No related merge requests found
......@@ -348,7 +348,7 @@ class RulesShippingFramework {
// Postal code Check for UK postal codes: Use regexp to determine if ZIP structure matches and also to extract the parts.
// Also handle UK overseas areas/islands that use four-letter outward codes rather than "A{1,2}0{1,2}A{0,1} 0AA"
$zip=strtoupper($zip);
if (isset($zip) and preg_match('/^\s*(([A-Z]{1,2})(\d{1,2})([A-Z]?)|[A-Z]{4}|GIR)\s*(\d[A-Z]{2})\s*$/', $zip, $match)) {
if (isset($zip) and preg_match('/^\s*(([A-Z]{1,2})(\d{1,2})([A-Z]?)|[A-Z]{4}|GIR|)\s*((\d|)([A-Z]{2}|))\s*$/', $zip, $match)) {
$values['uk_outward'] = $match[1];
$values['uk_area'] = $match[2];
$values['uk_district'] = $match[3];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment