Magento名字不能为空,无效的电子邮件地址
签出时出现错误: 名字不能为空,电子邮件地址无效。这些字段已填充Magento名字不能为空,无效的电子邮件地址,magento,checkout,billing,Magento,Checkout,Billing,签出时出现错误: 名字不能为空,电子邮件地址无效。这些字段已填充 public function validate() { $errors = array(); if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) { $errors[] = Mage::helper('customer')->__('The first name cannot be empty.');
public function validate()
{
$errors = array();
if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) {
$errors[] = Mage::helper('customer')->__('The first name cannot be empty.');
}
if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) {
$this->setLastname();
}
if (!Zend_Validate::is($this->getEmail(), 'EmailAddress')) {
$errors[] = Mage::helper('customer')->__('Invalid email address "%s".', $this->getEmail());
}
$password = $this->getPassword();
if (!$this->getId() && !Zend_Validate::is($password , 'NotEmpty')) {
$errors[] = Mage::helper('customer')->__('The password cannot be empty.');
}
if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
$errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
}
$confirmation = $this->getConfirmation();
if ($password != $confirmation) {
$errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
}
$entityType = Mage::getSingleton('eav/config')->getEntityType('customer');
$attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'dob');
if ($attribute->getIsRequired() && '' == trim($this->getDob())) {
$errors[] = Mage::helper('customer')->__('The Date of Birth is required.');
}
$attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'taxvat');
if ($attribute->getIsRequired() && '' == trim($this->getTaxvat())) {
$errors[] = Mage::helper('customer')->__('The TAX/VAT number is required.');
}
$attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'gender');
if ($attribute->getIsRequired() && '' == trim($this->getGender())) {
$errors[] = Mage::helper('customer')->__('Gender is required.');
}
if (empty($errors)) {
return true;
}
return $errors;
}
请帮助我..您是否在签出页面上使用任何特殊模块?我使用免费的swift onepagecheckout模块进行签出,但它工作正常..如何检查错误?您可以使用Mage::log('名字是'.$this->getFirstname())然后检查var/log/Christophe中的system.log,我是否必须使用您专有的代码创建一个文件并联机检查?谢谢。暂时您可以将其放入核心文件中,但测试后不要将其放在那里。。。