0

I'm using getRegion() and setRegion() but in my quote isn't saving values from setRegion(). How can I solve this problem?

2
  • have you tried using the debugger, debugger helps a lot in fining problems Jun 22 at 12:00
  • I use logger because my debbuger isn't working. can you give any solutions?
    – NoOn
    Jun 22 at 12:01

1 Answer 1

0

I think you need to understand that Magento has few methods and fields for region.

If selected country is has list of regions you need to update region_id. Use $address->setRegionId()

If selected country doesn't you need to update region. Use $address->setRegion()

Also Magento supports the methods setRegionCode and getRegionCode which are related to region data.

You can find defined regions data in directory_country_region table.

Magento has a logic to update region value before save quote address when passed valid region_id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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