Magento1.9.1 Please make sure your password match

2019-09-02 19:07发布

问题:

I am encountering this issue in CE1.9.1.

When a User registers (doesn't matter if its during checkout or from the Create an Account link) the user keeps getting the password mismatch error even though the password is re-entered correctly.

The form validation does not indicate a miss-match, but once a user clicks on Register it returns the mismatch error.

There is no errors in the chrome console...

I found this: https://magento.stackexchange.com/questions/37381/please-make-sure-your-passwords-match-password-error-in-checkout-with-new-re

But I don't believe it is the same error.

I need to fix it soon, any help is greatly appreciated!

回答1:

We also had this issue with 1 of our webshops. However we used a checkout extension. So im not sure if this applies for the regular standard checkout. Anyway.

The question should be, are u using a checkout extension?

If so, the value inside the model's file of that extension is set at:

 $customer->setConfirmation($password);

but should be:

$customer->setPasswordConfirmation($password);

For me this worked, without changing anything in the core. It's just that the extensions should get a small update, or you can do it manually like i did. Just find that line in the files of the model map of your extension.



回答2:

as workaround you can use folloing code:

$confirmation = $this->getConfirmation();
$passwordconfirmation = $this->getPasswordConfirmation();
//if ($password != $confirmation) {
if (!(($password == $confirmation) ||
    ($password == $passwordconfirmation))) {
    $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
}


回答3:

Changing app/code/core/Mage/Customer/Model/Customer.php as proposed by @Pedro breaks the functionality of "forgot password" and "edit customer account" pages. Instead, make the following changes to

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

by editing lines starting from 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);
}

and set the PasswordConfirmation -Property and not the Confirmation-Property of the Customer-Object:

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);
}


回答4:

Encountered the same problem and fixed it. Snel's answer is closer to right answer. The problem could lay in the external/local modules, so you should check not the

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

And of course do NOT modify it in any case! But you should find _validateCustomerData() method which is used in your case. Use Mage::log() or debug_backtrace() for it. It may look something like (but not exactly, because this part could be modified for some reason):

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);
}

Those modules extend the old version of core file so if you module wasn't updated, you should change them yourself and change

setConfirmation()

to its current usable analog:

setPasswordConfirmation()


回答5:

I also had this same problem. I'm not comfortable with code so I wanted to avoid all the above fiddling. To fix it all I did was update my extensions, and I also disable one page checkout, cleared cache, then re-enabled one-page checkout.

This has now fixed the problem without needing to modify code.

hope it helps for you.



回答6:

If anybody still can't figure out, why this is happening: The Conlabz Useroptin extension (http://www.magentocommerce.com/magento-connect/newsletter-double-opt-in-for-customers.html) can cause this behavior aswell.



回答7:

Unless this truly is a core bug, I wouldn't recommend changing core files.But i sloved this way Open app\code\core\Mage\Customer\Model\Customer.php and edit your code like below

$confirmation = $this->getConfirmation();
$passwordconfirmation = $this->getPasswordConfirmation();
//if ($password != $confirmation) {
if (!(($password == $confirmation) ||
    ($password == $passwordconfirmation))) {
    $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
}


回答8:

I had the same issue after updating to 1.9.2.1 and was unable to resolve using some of the suggested code changes here and elsewhere - also very reluctant to change core code for obvious reasons.

My solution - a configuration update. It was:

  • Enable OnePage Checkout = Yes
  • Allow Guest Checkout = Yes
  • Require Customer to be Logged in = No

I updated to Yes/No/Yes as per the above and cleared the cache. This resolved the issue by inserting the standard customer registration form (rather than appending the registration to end of the billing info) and passing that info to the billing form on successful registration.

It seems there is a code issue here along the lines of the other responses but this was an excellent workaround for me. Hope it helps.



回答9:

Change this code

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

to this code

$confirmation = $this->getConfirmation();