2

我进行了很多搜索以删除必填字段first name, Last name and confirm password,例如帐户创建页面中的字段。到目前为止,我required value from 1 to 0从表中重命名eav_attribute

在这之后我躲first name, Last Name, Confirm Password起来了register.phtml

但我仍然得到 The first name cannot be empty, The Last name cannot be empty, etc,..

有人知道怎么做吗?

请给我一个想法来解决这个问题..

4

1 回答 1

2

您必须更改另外两个文件:

更改 /js/prototype/validation.js 并注释掉以下行:

['validate-cpassword', 'Please make sure your passwords match.', function(v) {
                var conf = $('confirmation') ? $('confirmation') : $$('.validate-cpassword')[0];
                var pass = false;
                if ($('password')) {
                    pass = $('password');
                }
                var passwordElements = $$('.validate-password');
                for (var i = 0; i < passwordElements.size(); i++) {
                    var passwordElement = passwordElements[i];
                    if (passwordElement.up('form').id == conf.up('form').id) {
                        pass = passwordElement;
                    }
                }
                if ($$('.validate-admin-password').size()) {
                    pass = $$('.validate-admin-password')[0];
                }
                return (pass.value == conf.value);
            }],

之后,您还必须更改 Magento 客户核心模型。有两种类型的验证:通过前端 javascript 和后端客户模型。使用您自己的客户模块重写模型。然后复制 validate() 公共函数。并注释掉以下几行:

$confirmation = $this->getConfirmation();
        if ($password != $confirmation) {
            $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
        }
于 2012-10-18T20:24:22.230 回答