added more validation to customer guest, fixed issue after merge

This commit is contained in:
vishalsingh.qlo325
2025-05-16 15:43:57 +05:30
parent 187a913818
commit 2d6bc3ef6e
5 changed files with 15 additions and 37 deletions

View File

@@ -89,17 +89,8 @@ class IdentityControllerCore extends FrontController
}
}
$className = 'CustomerGuestDetail';
$rules = call_user_func(array($className, 'getValidationRules'), $className);
if ($phone && !Validate::isPhoneNumber($phone)) {
$this->errors[] = Tools::displayError('Invaid phone number.');
} elseif ($phone && Tools::strlen($phone) > $rules['size']['phone']) {
$this->errors[] = sprintf(Tools::displayError('Phone number is too long. (%s chars max).'), $rules['size']['phone']);;
} else {
$this->customer->phone = $phone;
}
if (!count($this->errors)) {
$this->customer->phone = $phone;
$this->customer->id_default_group = (int)$prev_id_default_group;
$this->customer->firstname = Tools::ucwords($this->customer->firstname);