Hello tout le monde, voici la solution :
Fichiers :
/classes/form/CustomerFormatter.php
/classes/form/CustomerForm.php
Ouvrir CustomerFormatter.php et chercher
$format['email'] = (new FormField())
au dessus de
if ($this->ask_for_new_password) {
$format['new_password'] = (new FormField())
->setName('new_password')
->setType('password')
->setLabel(
$this->translator->trans(
'New password', [], 'Shop.Forms.Labels'
)
)
;
}
mettre :
$format['conf_password'] = (new FormField)
->setName('conf_password')
->setType('password')
->setLabel(
$this->translator->trans(
'Confirm password', [], 'Shop.Forms.Labels'
)
)
->setRequired(true)
;
ensuite CustomerForm.php et chercher
public function validate()
après le code :
$emailField = $this->getField('email');
$id_customer = Customer::customerExists($emailField->getValue(), true, true);
$customer = $this->getCustomer();
if ($id_customer && $id_customer != $customer->id) {
$emailField->addError($this->translator->trans(
'The email is already used, please choose another one or sign in', array(), 'Shop.Notifications.Error'
));
}
mettre :
//Confirm password - check if is the same
$passwField = $this->getField('password');
$confPasswField = $this->getField('conf_password');
$passwordValue = $passwField->getValue();
$confPasswValue = $confPasswField->getValue();
if ($passwordValue != $confPasswValue) {
$confPasswField->addError($this->translator->trans(
"The password and the confirmation password don't match", array(), 'Shop.Notifications.Error'
));
}
ensuite mettre les fichiers dans :
/override/classes/form/
VIDER LE CACHE