update validation and error message

This commit is contained in:
Shreesh Arora
2024-08-08 14:53:31 +05:30
parent 22f3c2c024
commit 2d7979e43d
4 changed files with 6 additions and 6 deletions

View File

@@ -992,7 +992,7 @@ class AdminCustomersControllerCore extends AdminController
} else {
if ($customerDetail = CartCustomerGuestDetail::getCustomerDefaultDetails($customerEmail)) {
$objCartCustomerGuestDetail = new CartCustomerGuestDetail($customerDetail['id_customer_guest_detail']);
$objCartCustomerGuestDetail->phone = preg_replace('/[0-p]/', '0', $objCustomer->phone);
$objCartCustomerGuestDetail->phone = preg_replace('/[0-9]/', '0', $objCustomer->phone);
$objCartCustomerGuestDetail->email = $objCustomer->email;
$objCartCustomerGuestDetail->save();
}
@@ -1165,7 +1165,7 @@ class AdminCustomersControllerCore extends AdminController
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.');
$this->errors[] = sprintf(Tools::displayError('Phone number is too long. (%s chars max).'), $rules['size']['phone']);
}