Updated error message for guest account to customer account transformation

This commit is contained in:
vishalsingh.qlo325
2024-04-17 13:09:38 +05:30
parent 8dcfc9e892
commit 021a003ab3
2 changed files with 14 additions and 3 deletions

View File

@@ -95,8 +95,13 @@ class GuestTrackingControllerCore extends FrontController
} elseif (!Tools::getValue('password')) {
$this->errors[] = Tools::displayError('Invalid password.');
} elseif (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) {
// @todo clarify error message
$this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.');
if (!$customer->isGuest()) {
$this->errors[] = Tools::displayError('This account is already registered as a customer.');
}else if (!Validate::isPasswd(Tools::getValue('password'))) {
$this->errors[] = Tools::displayError('Invalid password.');
} else {
$this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.');
}
} else {
$this->context->smarty->assign('transformSuccess', true);
}

View File

@@ -176,7 +176,13 @@ class OrderOpcControllerCore extends ParentOrderController
if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
$this->context->updateCustomer($customer);
} else {
$this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.');
if (!$customer->isGuest()) {
$this->errors[] = Tools::displayError('This account is already registered as a customer.');
}else if (!Validate::isPasswd($passwd)) {
$this->errors[] = Tools::displayError('Invalid password.');
} else {
$this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.');
}
}
}