fixed phone number validation error on opc page

This commit is contained in:
Shreesh Arora
2024-08-05 20:28:34 +05:30
parent 3aac5a530b
commit 4c31e2a86d
5 changed files with 19 additions and 1 deletions

View File

@@ -1159,8 +1159,12 @@ class AdminCustomersControllerCore extends AdminController
$this->errors[] = Tools::displayError('Phone number is required.');
}
}
$className = 'CartCustomerGuestDetail';
$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[] = Tools::displayError('Invaid phone number.');
}