0

我在 CE1.9.1 中遇到了这个问题。

当用户注册时(无论是在结帐期间还是通过创建帐户链接),即使重新输入正确密码,用户也会不断收到密码不匹配错误。

表单验证并不表示不匹配,但是一旦用户单击注册,它就会返回不匹配错误。

chrome控制台中没有错误...

我发现了这个:https ://magento.stackexchange.com/questions/37381/please-make-sure-your-passwords-match-password-error-in-checkout-with-new-re

但我不相信这是同样的错误。

我需要尽快修复它,非常感谢任何帮助!

4

9 回答 9

5

我们的 1 个网店也遇到了这个问题。但是,我们使用了结帐扩展程序。所以我不确定这是否适用于常规标准结帐。反正。

问题应该是,您是否使用结帐扩展程序?

如果是这样,则该扩展名的模型文件中的值设置为:

 $customer->setConfirmation($password);

但应该是:

$customer->setPasswordConfirmation($password);

对我来说,这很有效,没有改变核心中的任何东西。只是扩展应该得到一个小的更新,或者你可以像我一样手动完成。只需在扩展的模型映射文件中找到该行。

于 2015-02-11T15:47:04.050 回答
2

作为解决方法,您可以使用以下代码:

$confirmation = $this->getConfirmation();
$passwordconfirmation = $this->getPasswordConfirmation();
//if ($password != $confirmation) {
if (!(($password == $confirmation) ||
    ($password == $passwordconfirmation))) {
    $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
}
于 2015-01-22T20:17:59.107 回答
1

按照@Pedro 的建议更改 app/code/core/Mage/Customer/Model/Customer.php 会破坏“忘记密码”和“编辑客户帐户”页面的功能。相反,进行以下更改

app/code/core/Mage/Checkout/Model/Type/Onepage.php

通过编辑从 369 开始的行

if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) {
  // set customer password
  $customer->setPassword($customerRequest->getParam('customer_password'));
  $customer->setConfirmation($customerRequest->getParam('confirm_password'));
} else {
  // emulate customer password for quest
  $password = $customer->generatePassword();
  $customer->setPassword($password);
  $customer->setConfirmation($password);
}

并设置 PasswordConfirmation -Property 而不是 Customer-Object 的 Confirmation-Property:

if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) {
  // set customer password
  $customer->setPassword($customerRequest->getParam('customer_password'));
  $customer->setPasswordConfirmation($customerRequest->getParam('confirm_password'));
} else {
  // emulate customer password for quest
  $password = $customer->generatePassword();
  $customer->setPassword($password);
  $customer->setPasswordConfirmation($password);
}
于 2015-01-20T20:47:10.660 回答
1

遇到了同样的问题并解决了。斯内尔的答案更接近正确答案。问题可能出在外部/本地模块中,因此您不应该检查

app/code/core/Mage/Checkout/Model/Type/Onepage.php

当然在任何情况下都不要修改它!但是您应该找到在您的案例中使用的 _validateCustomerData() 方法。使用 Mage::log() 或 debug_backtrace() 。它可能看起来像(但不完全是,因为这部分可能由于某种原因被修改):

if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) {
  // set customer password
  $customer->setPassword($customerRequest->getParam('customer_password'));
  $customer->setConfirmation($customerRequest->getParam('confirm_password'));
} else {
  // emulate customer password for quest
  $password = $customer->generatePassword();
  $customer->setPassword($password);
  $customer->setConfirmation($password);
}

这些模块扩展了核心文件的旧版本,因此如果您的模块没有更新,您应该自己更改它们并更改

setConfirmation()

对其当前可用的模拟:

setPasswordConfirmation()
于 2015-01-28T13:14:14.800 回答
0

我也有同样的问题。我对代码不满意,所以我想避免上述所有摆弄。为了解决这个问题,我所做的只是更新我的扩展程序,并且我还禁用了一页结帐,清除缓存,然后重新启用一页结帐。

这现在已经解决了问题,无需修改代码。

希望它对你有帮助。

于 2015-03-24T10:35:57.370 回答
0

除非这确实是一个核心错误,否则我不建议更改核心文件。但我喜欢这样打开 app\code\core\Mage\Customer\Model\Customer.php 并编辑您的代码,如下所示

$confirmation = $this->getConfirmation();
$passwordconfirmation = $this->getPasswordConfirmation();
//if ($password != $confirmation) {
if (!(($password == $confirmation) ||
    ($password == $passwordconfirmation))) {
    $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
}
于 2015-03-26T10:07:14.707 回答
0

如果有人仍然无法弄清楚,为什么会这样:Conlabz Useroptin 扩展 ( http://www.magentocommerce.com/magento-connect/newsletter-double-opt-in-for-customers.html ) 可能会导致这种情况行为也一样。

于 2015-05-28T10:14:33.440 回答
0

更新到 1.9.2.1 后我遇到了同样的问题,并且无法使用此处和其他地方的一些建议的代码更改来解决 - 由于明显的原因,我也非常不愿意更改核心代码。

我的解决方案 - 配置更新。它是:

  • 启用 OnePage Checkout = 是
  • 允许访客结帐 = 是
  • 要求客户登录 = 否

我根据上述更新为是/否/是并清除了缓存。这通过插入标准客户注册表单(而不是将注册附加到计费信息的末尾)并在成功注册时将该信息传递到计费表来解决问题。

与其他响应一样,这里似乎存在代码问题,但这对我来说是一个很好的解决方法。希望能帮助到你。

结帐配置设置

于 2015-10-28T23:45:28.080 回答
-1

更改此代码

app\code\core\Mage\Customer\Model\Customer.php
$confirmation = $this->getPasswordConfirmation();

到这个代码

$confirmation = $this->getConfirmation();
于 2014-12-09T21:04:02.000 回答