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
    – jonohara1
    Commented Jun 8, 2015 at 14:31
  • $billingaddress->getRegion()
    – Marius
    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!
    – jonohara1
    Commented Jun 8, 2015 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.