In checkout process when I select either "Checkout as a guest" or "Register" and then fill out the proper form, clicking on the button to go to the next step generates error. This is what the exception is caught:

{"error":-1,"message":"The first name cannot be empty., The last name cannot be empty., Invalid email address \"\"."}

The problem is I am inserting all the fields and when I debug using Firebug, these fields show as validation passed fields. So they pass the proper validation on client side, what could be causing this error then? Some kind of server side validation?

Can anyone please give me some solution for this issue? Why Magento is giving this error when all the fields are properly filled up?

Edit: I have debug the Onepage.php files of both my site as well as default Magento setup. The extractData method is returning an empty array in my site, which is causing error during validation because the fields are missing after the data is extracted. Can anyone please help me out here?

3 Answers 3


After spending lot of time, I got solution for this. If data is not getting from the extractData, you can set the value again for the firstname, lastname, email in app\code\core\Mage\Checkout\Model\Type\Onepage.php. You can copy paste Onepage.php to your local folder add the below lines look like below code.

$customer->setEmail($data['email']); $customer->setFirstname($data['firstname']); $customer->setLastname($data['lastname']);

    if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) {
        // set customer password
    } else {
        // spoof customer password for guest
        $customer->setEmail($data['email']); //email
        $customer->setFirstname($data['firstname']); //firstname
        $customer->setLastname($data['lastname']); //lastname
        $password = $customer->generatePassword();
        // set NOT LOGGED IN group id explicitly,
        // otherwise copyFieldset('customer_account', 'to_quote') will fill it with default group id value

    $result = $customer->validate();`

I hope it will work fine and it will be helpfull for someone.


This validation is server side, so either the data isn't passed to the server or it is removed somewhere before the validation.

Check what is passed and if the input fields so have the correct names.

  • the data is posted alright. Still it is not getting validated.
    – jdhaar
    Jan 6, 2014 at 9:15
  • Then I think the easiest is to hook into the validate Method: \Mage_Eav_Model_Form::validateData and check, what is validated. Jan 6, 2014 at 11:34
  • Hi, I hooked into the method that you suggested and in that method the result is returned with proper validation. No errors are generated. I don't know what else to do now.
    – jdhaar
    Jan 8, 2014 at 4:48
  • You hooked into \Mage_Customer_Model_Customer::validate? This is strange. But then the error comes from somewhere else :-/ Jan 8, 2014 at 6:19
  • 2
    I compared my own site files with that of a default Magento setup. This is what is happening. In the file Checkout/Model/Type/Onepage.php the extractData method is not returning anything at all. this is the line for that $customerForm->extractData($customerRequest);. It is returning an empty array in my site whereas in default Magento it returns an array of form fields.
    – jdhaar
    Jan 8, 2014 at 6:46


comment this line number 384 to 390

$customerErrors = $customerForm->validateData($customerData); if ($customerErrors !== true) { return array( 'error' => -1, 'message' => implode(', ', $customerErrors) ); }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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