Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
Rémi Gaillard
2013-01-09 19:09:09 +01:00
2 changed files with 16 additions and 18 deletions
+1 -1
View File
@@ -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);
} }
+11 -13
View File
@@ -254,19 +254,6 @@ class OrderControllerCore extends ParentOrderController
|| (Tools::isSubmit('same') && !Customer::customerHasAddress($this->context->customer->id, (int)Tools::getValue('id_address_invoice')))) || (Tools::isSubmit('same') && !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
{
// Add checking for all addresses
$address_without_carriers = $this->context->cart->getDeliveryAddressesWithoutCarriers();
if (count($address_without_carriers))
{
if (count($address_without_carriers) > 1)
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to some addresses you selected.', !Tools::getValue('ajax')));
elseif ($this->context->cart->isMultiAddressDelivery())
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to one of the address you selected.', !Tools::getValue('ajax')));
else
$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_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 = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)Tools::getValue('id_address_invoice');
@@ -282,6 +269,17 @@ class OrderControllerCore extends ParentOrderController
if (Tools::isSubmit('message')) if (Tools::isSubmit('message'))
$this->_updateMessage(Tools::getValue('message')); $this->_updateMessage(Tools::getValue('message'));
// Add checking for all addresses
$address_without_carriers = $this->context->cart->getDeliveryAddressesWithoutCarriers();
if (count($address_without_carriers))
{
if (count($address_without_carriers) > 1)
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to some addresses you selected.', !Tools::getValue('ajax')));
elseif ($this->context->cart->isMultiAddressDelivery())
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to one of the address you selected.', !Tools::getValue('ajax')));
else
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to the address you selected.', !Tools::getValue('ajax')));
} }
} }