Merge branch 'develop' into gli-1933

This commit is contained in:
vishalsingh.qlo325
2024-07-08 15:21:01 +05:30
56 changed files with 918 additions and 454 deletions

View File

@@ -1049,22 +1049,27 @@ class AdminCustomersControllerCore extends AdminController
$customer = new Customer();
if (Validate::isEmail($customer_email)) {
$customer->getByEmail($customer_email);
}
if ($customer->id) {
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
if ($customer->id) {
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
$this->display = 'edit';
return $customer;
} elseif (trim(Tools::getValue('passwd')) == '') {
$this->validateRules();
$this->errors[] = Tools::displayError('Password can not be empty.');
$this->display = 'edit';
} elseif ($customer = parent::processAdd()) {
$this->context->smarty->assign('new_customer', $customer);
return $customer;
}
} else {
$this->errors[] = Tools::displayError('Invalid email address.');
$this->display = 'edit';
return $customer;
} elseif (trim(Tools::getValue('passwd')) == '') {
$this->validateRules();
$this->errors[] = Tools::displayError('Password can not be empty.');
$this->display = 'edit';
} elseif ($customer = parent::processAdd()) {
$this->context->smarty->assign('new_customer', $customer);
return $customer;
}
return false;
}
public function processUpdate()
{
if (Validate::isLoadedObject($this->object)) {
@@ -1075,7 +1080,10 @@ class AdminCustomersControllerCore extends AdminController
$customer = new Customer();
if (Validate::isEmail($customer_email)) {
$customer->getByEmail($customer_email);
} else {
$this->errors[] = Tools::displayError('Invalid email address.');
}
if (($customer->id) && ($customer->id != (int)$this->object->id)) {
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
}