Magento – How to make the address field “company” required

billing-addressfieldsetsformsonepage-checkoutshipping-address

I simply would like to make the field "company" on the onepage checkout a required field. Would be happy for some help? I tried it already but it didn't work, so probably I have to change or add some more data in another file.

Best Answer

In magento by default customer address attribute "company" is not required.If you need required then update company attribute to bellow php script.

Run bellow script to update attribute

$installer = new Mage_Customer_Model_Entity_Setup('core_setup');
$installer->startSetup();


/*** Update customer address attributes*/
$installer->updateAttribute('customer_address', 'company', 'is_required', 1); 

$installer->endSetup();