diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index ab05a2876..ad2a0cb29 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -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); } diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 465c6a7ca..e109721a6 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -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.'); + } } }