Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -63,6 +63,6 @@ function smartyTranslate($params, &$smarty)
|
|||||||
if ($params['sprintf'] !== null)
|
if ($params['sprintf'] !== null)
|
||||||
$msg = Translate::checkAndReplaceArgs($msg, $params['sprintf']);
|
$msg = Translate::checkAndReplaceArgs($msg, $params['sprintf']);
|
||||||
|
|
||||||
return $params['js'] ? addslashes($msg) : $msg;
|
return $params['js'] ? $msg : Tools::safeOutput($msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -255,6 +255,21 @@ class OrderControllerCore extends ParentOrderController
|
|||||||
$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_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)Tools::getValue('id_address_invoice');
|
||||||
|
|
||||||
|
CartRule::autoRemoveFromCart($this->context);
|
||||||
|
CartRule::autoAddToCart($this->context);
|
||||||
|
|
||||||
|
if (!$this->context->cart->update())
|
||||||
|
$this->errors[] = Tools::displayError('An error occurred while updating your cart.', !Tools::getValue('ajax'));
|
||||||
|
|
||||||
|
if (!$this->context->cart->isMultiAddressDelivery())
|
||||||
|
$this->context->cart->setNoMultishipping(); // If there is only one delivery address, set each delivery address lines with the main delivery address
|
||||||
|
|
||||||
|
if (Tools::isSubmit('message'))
|
||||||
|
$this->_updateMessage(Tools::getValue('message'));
|
||||||
|
|
||||||
// Add checking for all addresses
|
// Add checking for all addresses
|
||||||
$address_without_carriers = $this->context->cart->getDeliveryAddressesWithoutCarriers();
|
$address_without_carriers = $this->context->cart->getDeliveryAddressesWithoutCarriers();
|
||||||
if (count($address_without_carriers))
|
if (count($address_without_carriers))
|
||||||
@@ -266,23 +281,6 @@ class OrderControllerCore extends ParentOrderController
|
|||||||
else
|
else
|
||||||
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to the address you selected.', !Tools::getValue('ajax')));
|
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to the address you selected.', !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');
|
|
||||||
|
|
||||||
CartRule::autoRemoveFromCart($this->context);
|
|
||||||
CartRule::autoAddToCart($this->context);
|
|
||||||
|
|
||||||
if (!$this->context->cart->update())
|
|
||||||
$this->errors[] = Tools::displayError('An error occurred while updating your cart.', !Tools::getValue('ajax'));
|
|
||||||
|
|
||||||
if (!$this->context->cart->isMultiAddressDelivery())
|
|
||||||
$this->context->cart->setNoMultishipping(); // If there is only one delivery address, set each delivery address lines with the main delivery address
|
|
||||||
|
|
||||||
if (Tools::isSubmit('message'))
|
|
||||||
$this->_updateMessage(Tools::getValue('message'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->errors)
|
if ($this->errors)
|
||||||
|
|||||||
Reference in New Issue
Block a user