When i try creating order from magento admin, I want to make the state filed mandatory for shipping/billing address

I went to the sales module and found out that the fields are coming from the customer address model.

protected function _prepareForm()

I can see $addressModel = Mage::getModel('customer/address');

I checked the customer module for the fields but was unable to find it out. Can i do it using customer module XML config files? OR any php code is required OR should i run a direct query in the database to make required = 1

  • Where/what should explain more? – zamil Aug 6 '14 at 6:08
  • I think by default it's in mandatory condition. now I checked – saravanavelu Aug 6 '14 at 6:10
  • Its not mandatory.I use mage 1.5 * – zamil Aug 6 '14 at 6:21
  • do you want to make it mandatory for admin only? altering database will do it for both front and backend – MTM Aug 6 '14 at 6:44
  • @MTM: For both. Admin and frontend – zamil Aug 6 '14 at 7:02

Run this query in your database, you get expected result in all pages

UPDATE eav_attribute SET is_required = 1 WHERE attribute_code = 'region'
| improve this answer | |

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.