Jump to content

PrestaShop error Invalid email/password combination - not able to register


Edge_jr

Recommended Posts

 

This problem can be fixed by commenting condition check in file location psrootfolder/classes/form/CustomerPersister.php


 

private function update(Customer $customer, $clearTextPassword, $newPassword, $passwordRequired = true)
    {
        /*
        if (!$customer->is_guest && $passwordRequired && !$this->crypto->checkHash(
            $clearTextPassword,
            $customer->passwd,
            _COOKIE_KEY_
        )) {
            $msg = $this->translator->trans(
                'Invalid email/password combination',
                [],
                'Shop.Notifications.Error'
            );
            $this->errors['email'][] = $msg;
            $this->errors['password'][] = $msg;

            return false;
        }
    */

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

You can edit zip code format for every country separately in B.O. under International -> Locations -> Countries tab -> select country and then you see "Zip/postal code format".

You can also disable this validation in /classes/Validate.php, method "isZipCodeFormat()". But better would be to override Validate class and change isZipCodeFormat() method there (https://devdocs.prestashop.com/1.7/modules/concepts/overrides/)

zip.png

Link to comment
Share on other sites

 

This problem can be fixed by commenting condition check in file location psrootfolder/classes/form/CustomerAddressForm.php
 

public function validate()
{
    $is_valid = true;
    /*
    if (($postcode = $this->getField('postcode'))) {
        if ($postcode->isRequired()) {
            $country = $this->formatter->getCountry();
            if (!$country->checkZipCode($postcode->getValue())) {
                $postcode->addError($this->translator->trans(
                    'Invalid postcode - should look like "%zipcode%"',
                    array('%zipcode%' => $country->zip_code_format),
                    'Shop.Forms.Errors'
                ));
                $is_valid = false;
            }
        }
    }
    */

    if (($hookReturn = Hook::exec('actionValidateCustomerAddressForm', array('form' => $this))) !== '') {
        $is_valid &= (bool) $hookReturn;
    }

    return $is_valid && parent::validate();
}

 

Link to comment
Share on other sites

  • 6 months later...
On 10/18/2020 at 12:14 PM, Zohaib-fk said:

 

This problem can be fixed by commenting condition check in file location psrootfolder/classes/form/CustomerPersister.php


 


private function update(Customer $customer, $clearTextPassword, $newPassword, $passwordRequired = true)
    {
        /*
        if (!$customer->is_guest && $passwordRequired && !$this->crypto->checkHash(
            $clearTextPassword,
            $customer->passwd,
            _COOKIE_KEY_
        )) {
            $msg = $this->translator->trans(
                'Invalid email/password combination',
                [],
                'Shop.Notifications.Error'
            );
            $this->errors['email'][] = $msg;
            $this->errors['password'][] = $msg;

            return false;
        }
    */

 

It's working for me ! You are awesome Zohaib-fk Thank you very much

Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...