// guest checkout works with the 2 registration process

This commit is contained in:
vChabot
2011-10-03 14:35:43 +00:00
parent 12ea941767
commit 0c4a6aede9
+3 -3
View File
@@ -314,7 +314,7 @@ class AuthControllerCore extends FrontController
if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile') && Configuration::get('PS_REGISTRATION_PROCESS_TYPE')) if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile') && Configuration::get('PS_REGISTRATION_PROCESS_TYPE'))
$this->errors[] = Tools::displayError('You must register at least one phone number'); $this->errors[] = Tools::displayError('You must register at least one phone number');
$this->errors = array_unique(array_merge($this->errors, $customer->validateController())); $this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax) if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount'))
{ {
if (!count($this->errors)) if (!count($this->errors))
{ {
@@ -449,7 +449,7 @@ class AuthControllerCore extends FrontController
else else
{ {
$address->id_customer = (int)$customer->id; $address->id_customer = (int)$customer->id;
if ((Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || $this->ajax) && !$address->add()) if ((Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || $this->ajax || Tools::isSubmit('submitGuestAccount')) && !$address->add())
$this->errors[] = Tools::displayError('An error occurred while creating your address.'); $this->errors[] = Tools::displayError('An error occurred while creating your address.');
else else
{ {
@@ -482,7 +482,7 @@ class AuthControllerCore extends FrontController
die(Tools::jsonEncode($return)); die(Tools::jsonEncode($return));
} }
// if registration type is in two steps, we redirect to register address // if registration type is in two steps, we redirect to register address
if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax) if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount'))
Tools::redirect('index.php?controller=address'); Tools::redirect('index.php?controller=address');
if ($back = Tools::getValue('back')) if ($back = Tools::getValue('back'))
Tools::redirect('index.php?controller='.$back); Tools::redirect('index.php?controller='.$back);