[-] FO : Fix #PSCFV-6209 required phone with Guest Checkout
This commit is contained in:
@@ -377,8 +377,18 @@ class AuthControllerCore extends FrontController
|
||||
$_POST['lastname'] = Tools::getValue('customer_lastname');
|
||||
$_POST['firstname'] = Tools::getValue('customer_firstname');
|
||||
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone') && !Tools::getValue('phone_mobile') &&
|
||||
(Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || Configuration::get('PS_GUEST_CHECKOUT_ENABLED')))
|
||||
$error_phone = false;
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST'))
|
||||
{
|
||||
if (Tools::isSubmit('submitGuestAccount') || !Tools::getValue('is_new_customer'))
|
||||
{
|
||||
if (!Tools::getValue('phone'))
|
||||
$error_phone = true;
|
||||
}
|
||||
elseif (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || Configuration::get('PS_ORDER_PROCESS_TYPE') && (!Tools::getValue('phone') || !Tools::getValue('phone_mobile')))
|
||||
$error_phone = true;
|
||||
}
|
||||
if ($error_phone)
|
||||
$this->errors[] = Tools::displayError('You must register at least one phone number');
|
||||
|
||||
$this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
|
||||
|
||||
Reference in New Issue
Block a user