Skip to content

Commit 618c0cb

Browse files
Use Google country short name in zip lookup
1 parent fd71662 commit 618c0cb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/ZipLookup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function getCityStateByZip($zip)
4141
$loc_level_3 = (string) $value->long_name;
4242
}
4343
if ($value->type[0] == 'country') {
44-
$loc_level_4 = (string) $value->long_name;
44+
$loc_level_4 = (string) $value->short_name;
4545
}
4646
}
4747
} else {
@@ -53,7 +53,7 @@ public function getCityStateByZip($zip)
5353

5454
// Set the state based on US or non-US location
5555
$aAddress[2] = $loc_level_1;
56-
if ($loc_level_4 == 'United States') {
56+
if ($loc_level_4 == 'US') {
5757
$aAddress[3] = $loc_level_3;
5858
} else {
5959
$aAddress[3] = $loc_level_2;

0 commit comments

Comments
 (0)