[-] FO : remove "Invalid address warning" when not "same" an no invoice address
This commit is contained in:
1 parent
9be5d8ac64
commit
eb48c91eac
1 file changed
+6
-2
@@ -250,14 +250,18 @@ class OrderControllerCore extends ParentOrderController
|
|||||||
if (!Tools::getValue('multi-shipping'))
|
if (!Tools::getValue('multi-shipping'))
|
||||||
$this->context->cart->setNoMultishipping();
|
$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'))
|
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'))))
|
&& !Customer::customerHasAddress($this->context->customer->id, (int)Tools::getValue('id_address_invoice'))))
|
||||||
$this->errors[] = Tools::displayError('Invalid address', !Tools::getValue('ajax'));
|
$this->errors[] = Tools::displayError('Invalid address', !Tools::getValue('ajax'));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->context->cart->id_address_delivery = (int)Tools::getValue('id_address_delivery');
|
$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::autoRemoveFromCart($this->context);
|
||||||
CartRule::autoAddToCart($this->context);
|
CartRule::autoAddToCart($this->context);
|
||||||
|
|||||||
Reference in new issue
Block a user