Guest maolaun Posted October 10, 2011 Share Posted October 10, 2011 I am running into an issue with grabbing the state abbreviation using this code$this->_basket['billing_address']['state_abbrev'] If I run through the checkout process with a new user, the full state name will be submitted to the payment gateway. However, if I go back and edit the billing address and change the state name, and continue with the checkout process, the state abbreviation will be submited properly to the gateway. Is there somewhere other than $this->_basket['billing_address']['state_abbrev'] I should be pulling the state code from? Your help is greatly appreciated! Quote Link to comment Share on other sites More sharing options...
Guest kmdev Posted November 8, 2011 Share Posted November 8, 2011 Try this, found it in one of the payment modules (sagepay) whilst having a look around... if($this->_basket['delivery_address']['country_iso']=="US") { if(strlen($this->_basket['billing_address']['state_abbrev']) > 2) { $this->_basket['billing_address']['state_abbrev'] = getStateFormat($this->_basket['billing_address']['state_abbrev'], 'name', 'abbrev'); } } If they are making this check then it would seem you are not the only one getting state codes that are longer than 2 chars. The getStateFormat function is defined in includes/functions.inc.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.