Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 增值税字段唯一,如电子邮件magento注册页面_Php_Magento - Fatal编程技术网

Php 增值税字段唯一,如电子邮件magento注册页面

Php 增值税字段唯一,如电子邮件magento注册页面,php,magento,Php,Magento,我正在尝试使magento注册的taxvat字段成为唯一字段,但我有点困惑如何使其成为唯一字段,因此每个人都需要添加唯一的vat编号。 在这里,我在accountcontroller.php中找到了电子邮件 catch (Mage_Core_Exception $e) { $session->setCustomerFormData($this->getRequest()->getPost()); if ($e->getCo

我正在尝试使magento注册的taxvat字段成为唯一字段,但我有点困惑如何使其成为唯一字段,因此每个人都需要添加唯一的vat编号。 在这里,我在accountcontroller.php中找到了电子邮件

 catch (Mage_Core_Exception $e) {
            $session->setCustomerFormData($this->getRequest()->getPost());
            if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
                $url = Mage::getUrl('customer/account/forgotpassword');
                $message = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $url);
                $session->setEscapeMessages(false);
            }
            else {
                $message = $e->getMessage();
            }
            $session->addError($message);
        }
catch(Mage\u Core\u异常$e){
$session->setCustomPerformData($this->getRequest()->getPost());
如果($e->getCode()==Mage\u Customer\u Model\u Customer::EXCEPTION\u EMAIL\u存在){
$url=Mage::getUrl('customer/account/forgotpassword');
$message=$this->(已有一个帐户使用此电子邮件地址。如果您确定这是您的电子邮件地址,请获取您的密码并访问您的帐户。“,$url);
$session->setEscapeMessages(false);
}
否则{
$message=$e->getMessage();
}
$session->addError($message);
}

现在我想让我的taxvat字段也是唯一的,比如电子邮件地址,我该怎么做?有人有它的代码吗?

我手头没有Magento数据库来检查这一点,但您可能可以将此属性设置为“唯一”。 查看一下您的customer\u属性表(或者eav\u属性,我不确定)


如果这样做有效,请切换回正常状态并创建一个安装文件,该文件将更新模块安装目录中的属性。

请自己创建代码。我已经尝试过了,但无法启用唯一字段。因为它被禁用以进行更改。我可以更改名称和其他名称,但唯一值已锁定,因此无法更改。