Zen Follower
- Join Date:
- Nov 2007
- Location:
- Essex, UK
- Posts:
- 137
- Plugin Contributions:
- 1
Help with state codes
Hi , I need to update my payment script so as if any americans order the customers address details include the state code.
I have written this
if ($order->delivery['country']['iso_code_2'] == 'US') {
$plain .= "DeliveryState=" . $order->delivery['state'] . "&";
}else{
$plain .= "DeliveryState=" . "" . "&";
}
which sends the state detail only when the customer is from the US, however the field
$order->delivery['state']
sends the state name in full i.e. Alabama and I need to sent just the 2 digit state code.
I have tried lots of different things but unfortunatly I can not seem to get the state code, yet I know (because i've checked) that the database does include these codes.
Any help would be much appriciated.