[-] FO : remove "Invalid address warning" when not "same" an no invoice address
This commit is contained in:
@@ -249,15 +249,19 @@ class OrderControllerCore extends ParentOrderController
|
||||
{
|
||||
if (!Tools::getValue('multi-shipping'))
|
||||
$this->context->cart->setNoMultishipping();
|
||||
|
||||
|
||||
$same = Tools::isSubmit('same');
|
||||
if(!Tools::getValue('id_address_invoice', false) && !$same)
|
||||
$same = true;
|
||||
|
||||
if (!Customer::customerHasAddress($this->context->customer->id, (int)Tools::getValue('id_address_delivery'))
|
||||
|| (!Tools::isSubmit('same') && Tools::getValue('id_address_delivery') != Tools::getValue('id_address_invoice')
|
||||
|| (!$same && Tools::getValue('id_address_delivery') != Tools::getValue('id_address_invoice')
|
||||
&& !Customer::customerHasAddress($this->context->customer->id, (int)Tools::getValue('id_address_invoice'))))
|
||||
$this->errors[] = Tools::displayError('Invalid address', !Tools::getValue('ajax'));
|
||||
else
|
||||
{
|
||||
$this->context->cart->id_address_delivery = (int)Tools::getValue('id_address_delivery');
|
||||
$this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)Tools::getValue('id_address_invoice');
|
||||
$this->context->cart->id_address_invoice = $same ? $this->context->cart->id_address_delivery : (int)Tools::getValue('id_address_invoice');
|
||||
|
||||
CartRule::autoRemoveFromCart($this->context);
|
||||
CartRule::autoAddToCart($this->context);
|
||||
|
||||
Reference in New Issue
Block a user