postcode tweak

This commit is contained in:
Mike Jolley 2012-03-11 14:09:47 +00:00
parent b5f9d33264
commit adcd894c60
2 changed files with 6 additions and 6 deletions

View File

@ -113,13 +113,9 @@ class WC_Validation {
$postcode = trim(preg_replace('/[\s]/', '', $postcode));
if ($country=='GB') :
if (strlen($postcode)==7)
$postcode = substr_replace($postcode, ' ', 4, 0);
elseif (strlen($postcode)==5)
$postcode = substr_replace($postcode, ' ', 2, 0);
else
$postcode = substr_replace($postcode, ' ', 3, 0);
$postcode = substr_replace($postcode, ' ', -3, 0);
endif;
return $postcode;
}

View File

@ -143,6 +143,10 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Changelog ==
= 1.5.2 =
* Fixed notice in GA code
* Postcode format tweak
= 1.5.1 - 08/03/2012 =
* Persistent (logged-in) customer carts (thanks dominic-p)
* Error suppression on set_time_out