[-] : Fix bug #PSCFV-4859, could not register invoice address or invoice country in OPC as guest, and phone not required in standard registration

This commit is contained in:
gRoussac
2013-10-20 23:52:48 +02:00
parent c36625a136
commit f2d70076bd
6 changed files with 312 additions and 152 deletions
+7 -7
View File
@@ -225,19 +225,19 @@ class AddressControllerCore extends FrontController
else // Update cart address
$this->context->cart->autosetProductAddress();
if ((bool)(Tools::getValue('select_address', false)) == true OR Tools::getValue('type') == 'invoice' && Configuration::get('PS_ORDER_PROCESS_TYPE'))
{
if ((bool)(Tools::getValue('select_address', false)) == true OR (Tools::getValue('type') == 'invoice' && Configuration::get('PS_ORDER_PROCESS_TYPE')))
$this->context->cart->id_address_invoice = (int)$address->id;
$this->context->cart->update();
}
elseif (Configuration::get('PS_ORDER_PROCESS_TYPE'))
$this->context->cart->id_address_invoice = (int)$this->context->cart->id_address_delivery;
$this->context->cart->update();
if ($this->ajax)
{
$return = array(
'hasError' => (bool)$this->errors,
'errors' => $this->errors,
'id_address_delivery' => $this->context->cart->id_address_delivery,
'id_address_invoice' => $this->context->cart->id_address_invoice
'id_address_delivery' => (int)$this->context->cart->id_address_delivery,
'id_address_invoice' => (int)$this->context->cart->id_address_invoice
);
die(Tools::jsonEncode($return));
}