0

My payment gateway (Ecorepay) requires customer address to include state/province.

It works when I pass the region_id (for countries where I have a drop down list) my question is where is the region stored if there is no drop down list and the value has simply been added as free text? Can see it in any of the order table in the database...

1 Answer 1

0

The region name is kept in the region attribute of the address.
So if you call $address->getRegion() you will get the region name in both cases (where region_id is populated and when it's not).

3
  • Thanks Marius at the moment the code is... '$regionModel = Mage::getModel('directory/region')->load($billingaddress->getData('region_id'));' then ''State'=> $regionModel->getCode(),' How do i get simply the region from $address Commented Jun 8, 2015 at 14:31
  • $billingaddress->getRegion() Commented Jun 8, 2015 at 14:39
  • Great that's a great help. I'm now having problems because when the 'country' is US it's expecting a 2 character code eg TX rather than Texas but requires the free text from other countries! Commented Jun 8, 2015 at 16:14

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.