Feature request from hostep, posted on GitHub Aug 17, 2015
Why is the telephone number still required on a customer address? We hear from our shop owners that a lot of customers refuse to enter something in there or just enter gibberish.
An ideal solution would be if you could add a configuration option in the backend similar to the
Tax/Vat Number and
Date of Birth fields.
So an option for showing the telephone number where you can choose between
Required. What do you think?
I had to implement this today into a Magento CE 1.x store and it was kind of a terrible experience, changing stuff in the database, remove the hard coded validation of that field (which is still present btw: https://github.com/magento/magento2/blob/93312cae42824274722fe7a285d5ce8e40f177a1/app/code/Magento/C...), ...
Comment from joellarsson130, posted on GitHub Jul 15, 2016
I can disable the Zend_validate but can't make sure about the JS
Comment from andidhouse, posted on GitHub Jul 19, 2016
If there is no chance to make this as an option in a magento release it would be great to have a documentation explaining how to delete tel. number or make it not a required field. Many people asked for this and i can not find any official documentation here. Can you pls provide this for the moment for us?
Comment from ludwig-gramberg, posted on GitHub Jul 19, 2016
just a rough overview: in di.xml we addressed:
<preference for="Magento\Sales\Model\Order\Address\Validator" type="Your\Module\Model\Order\Address\Validator" />
<preference for="Magento\Customer\Model\Address" type="Your\Module\Model\Address" />
<preference for="Magento\Quote\Model\Quote\Address" type="Your\Module\Model\Quote\Address" />
<preference for="Magento\Customer\Model\ResourceModel\AddressRepository" type="Your\Module\Model\ResourceModel\AddressRepository" />
in each instance we extended the original class and replaced the following methods:
\Magento\Customer\Model\ResourceModel\AddressRepository::_validatethe method is private so you will have to implement a copy of this method and replace the save method instead, using your own _validateX method
in the database we changed the telephone attribute required flag and removed the validation (not sure if the last part is necessary, maybe if someone enters a value you still want it validated)
Email me when someone replies
Why is this still not fixed? It's absolutely RIDICULOUS not being able to make the telephone number field optional. I know that if a merchant requires this when I check out online, I abandon the cart, or give them a fake number. I shop online all the time, and NEVER give out my number. What will it take for this to be implemented?
A shop selling virtual products with bitcoins isn't going to be needing phone numbers, addresses, or anything besides a name and email.
I have created a module which removes the requirement on the telephone input:
It can be installed via composer