diff --git a/modules/addcustomer/controllers/front/form.php b/modules/addcustomer/controllers/front/form.php index 9119eaf..0a633ac 100755 --- a/modules/addcustomer/controllers/front/form.php +++ b/modules/addcustomer/controllers/front/form.php @@ -25,14 +25,14 @@ class addCustomerFormModuleFrontController extends ModuleFrontController private function processRequest() { - if (Tools::getValue('lastName')) { - if (!Validate::isName(Tools::getValue('lastName'))) { - $this->errors = Tools::displayError('Veuillez renseigner un nom correct'); - } - } elseif (Tools::getValue('firstName')) { - if (!Validate::isName(Tools::getValue('firstName'))) { - $this->errors = Tools::displayError('Veuillez renseigner un prenom correct'); - } + if (!Tools::getValue('lastName')) { + $this->errors = Tools::displayError('Un nom est requis'); + } elseif (!Validate::isName(Tools::getValue('lastName'))) { + $this->errors = Tools::displayError('Veuillez renseigner un nom correct'); + } elseif (!Tools::getValue('firstName')) { + $this->errors = Tools::displayError('Un nom est requis'); + } elseif (!Validate::isName(Tools::getValue('firstName'))) { + $this->errors = Tools::displayError('Veuillez renseigner un prenom correct'); } elseif (!Tools::getValue('phoneNumber')) { $this->errors = Tools::displayError('Un numéro est requis'); } elseif (!Validate::isPhoneNumber(Tools::getValue('phoneNumber'))) { diff --git a/modules/addcustomer/views/templates/front/form.tpl b/modules/addcustomer/views/templates/front/form.tpl index 11f3afb..6a4ed48 100644 --- a/modules/addcustomer/views/templates/front/form.tpl +++ b/modules/addcustomer/views/templates/front/form.tpl @@ -15,12 +15,12 @@
{$errors}
{/if}
- - + +
- - + +