I have overrided customer edit form. But while saving record I'm getting error message
"Telephone" is a required value.
I don't want telephone field. So in my form telephone field is not there but still error is coming.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI have overrided customer edit form. But while saving record I'm getting error message
"Telephone" is a required value.
I don't want telephone field. So in my form telephone field is not there but still error is coming.
There is a Magento2 feature that is by default telephone field is required. There is a lot of discussion on below topic:
https://github.com/magento/magento2/issues/1691
There is also a suggestion on this topic that we can make it optional by running SQL script
update eav_attribute set is_required=0 where attribute_code='telephone';
Read full topic and then run the query.
Note: Take a backup of DB before making any change.
After run query check eav_attribute
table and make sure attribute column value changed to is_required
to 0
.
Run reindex command for attributes only
php bin/magento indexer:reindex catalog_product_attribute
and delete all cache and static files, compile and regenerate code by below command
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
Hope this will help you.
You can remove telephone field from using following changes.
update eav_attribute set is_required=0 where attribute_code='telephone';
I followed the steps in the answer by akgola, except instead of following the step:
php bin/magento indexer:reindex catalog_product_attribute
I instead ran
php bin/magento indexer:reindex customer_grid
and this worked for me. It is a customer and not product attribute being updated, so that is probably why that answer isn't working for others?