1

My Registration form shows "Phone Number" is a required value, even after entering telephone correctly.

I have placed the following code in register form

<?=$this->setShowAddressFields(true);?>

and removed the "required entry" from class name of the textbox. Also set the is_required value to 0 in eav_attribute table. Then commented the following in abstract.php file

if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
            $this->addError(Mage::helper('customer')->__('Please enter the telephone number.'));
        }

**

How can I save the customer details successfully???

1

Ive seen this problem before, it turned out that the block for the address was being included in the html twice. Therefore you end up with two identical input forms, one with the content, and a second one not visible, which has no value - this is the field which is actually failing the validation but the javascript is triggering the warning on the first (visible) one.

If you view the source code, and look for the field name, if you see a second one then you have the same problem. You likely have a layout modification which is putting in the block for a second time somewhere.

1

*in /app/code/local/Mage/Customer/Model/Address/Abstract.php file

if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
        $errors[] = Mage::helper('customer')->__('Please enter the telephone number.');
}

change to:

/*
        // Disable telephone field validation 
        if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
            $errors[] = Mage::helper('customer')->__('Please enter the telephone number.');
        }
*/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.