0

I would like to make lastname, telephone, zipcode and city as optional field in billing address column since our site is internal. So created a mysql script and changed the version in config file. After clearing the cache I loaded the page. In eav_attribute table those fields are updated as non required field, but still I am getting the validation message as attached.

enter image description here

Whats the wrong with this?

mysql upgrade script:

<?php
    $installer = $this;

$installer->startSetup();
/*** Update customer address attributes*/
$installer->updateAttribute('customer_address', 'lastname', 'is_required', 0);
$installer->updateAttribute('customer_address', 'telephone', 'is_required', 0);
$installer->updateAttribute('customer_address', 'city', 'is_required', 0);
$installer->updateAttribute('customer_address', 'postcode', 'is_required', 0);

$installer->endSetup();
?>
10
  • @SanderMangel I read the link. I I change in abstract.php wont it affect other areas?
    – Butterfly
    Sep 7 '15 at 15:00
  • postcode is used for shipping calculations and make it optional will probably cause a whole list of errors and issues. You might want to rethink removing it as required
    – Sander Mangel
    Sep 7 '15 at 15:00
  • Yes it will also in the customer section of Magento where you add your address
    – Sander Mangel
    Sep 7 '15 at 15:01
  • @SanderMangel If I modify in Mage/Customer/Model/Address/Abstract.php. directly wont it affect if I upgrade my magento version, I read from blog that we should not modify the core code
    – Butterfly
    Sep 7 '15 at 15:04
  • No I agree, you're absolutely right. But this is currently the only place where it can be removed. I might have a work around, give me a sec
    – Sander Mangel
    Sep 7 '15 at 15:10