Magento Backend – Fix Missing Email Field for New Orders and Customers

backendorders

we have th strangest problem. In admin/sales_order_create/index the email field is missing. We actually found this in 2 stores.

The form is loaded here

app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php

// add system required attributes
foreach ($customerForm->getSystemAttributes() as $attribute) {
    /* @var $attribute Mage_Customer_Model_Attribute */
    if ($attribute->getIsRequired()) {
        $attributes[$attribute->getAttributeCode()] = $attribute;
    }
}

It seems that $attribute->getIsRequired() is not true for $attribute->getAttributeCode()=="email"

I have seen this for the 3rd time now in 3 stores.

Question: Where and how can the required-ness of the "email" attribute be changed? (so we don't see this problem anymore)

enter image description here

Best Answer

We changed this line to:

    if ($attribute->getIsRequired()||$attribute->getAttributeCode()=="email") { // TEMP MODIFICATION
        $attributes[$attribute->getAttributeCode()] = $attribute; 
    }

But I don't know how the required-ness of the "email" attribute changed. If someone has an answer to that I am very interested

Related Topic