By submitting forms billing and shipping, return message “Telephone this required field”
Question
When I fill out the form and send to customer base, magento returns the message Telephone is a required field
I've tried removing the validation of the phone field in HTML, JS and Databases, yet still blocking me the customer base.
It sends the value of the completed field, but still returns a message that is a required field
Solution
To remove validation for telephone number. You need to do three things.
Step 1:
remove client side validation for telephone input field.(remove validation class) In following files
checkout/onepage/shipping.phtml
checkout/onepage/billing.phtml persistent/checkout/onepage/billing.phtml
Step 2:
Need to remove validation from code side.
app/code/core/Mage/Customer/Model/Address/Abstract.php
Copy this file to local
app/code/local/Mage/Customer/Model/Address/Abstract.php
Then find a line
if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
$this->addError(Mage::helper('customer')->__('Please enter the telephone number.'));
}
Comment the above lines to remove the validation from code side
Step 3: Need to remove validation value from DB. For that follow @saravanvelu answer.
OTHER TIPS
I think it may be due to that the telephone is the required field in eav_attribute
table.
Try this,
To change the required field value ,
//31 is telephone's attribute id in eav_attribute table
//2 is entity_type_id for customer/address in eav_entity_type table
UPDATE `eav_attribute` SET `is_required`= 0 WHERE `attribute_id` = 31 and `entity_type_id` = 2
To remove validation rules for telephone field,
UPDATE `customer_eav_attribute` SET `validate_rules`= null WHERE `attribute_id` = 31