[-] FO : Fix #PSCFV-6209 required phone with Guest Checkout

This commit is contained in:
Gregory Roussac
2012-12-27 18:05:26 +01:00
parent dbb8a9f2e0
commit 33f09fb92f
+12 -2
View File
@@ -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()));