1

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.

app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Form\Address.php 
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

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

1 Answer 1

2

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

UPDATE eav_attribute SET is_required = 1 WHERE attribute_code = 'region'

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.