From 740fb1283e7abcf06ff700cc61f6fb5d943cdc0a Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Thu, 26 Apr 2012 08:55:10 +0000 Subject: [PATCH] [-] BO : #PSCFV-1669 - Fix bug with customer add form, when an account already exists with the same email adddress --- controllers/admin/AdminCustomersController.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index ee649123b..5101d89ad 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -715,17 +715,16 @@ class AdminCustomersControllerCore extends AdminController if (Validate::isEmail($customer_email)) $customer->getByEmail($customer_email); if ($customer->id) - $this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; - else { - if ($customer = parent::processAdd()) - { - $this->context->smarty->assign('new_customer', $customer); - return true; - } - else - return false; + $this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; + $this->display = 'edit'; } + elseif ($customer = parent::processAdd()) + { + $this->context->smarty->assign('new_customer', $customer); + return true; + } + return false; } public function processUpdate()