[-] FO : #PSCFV-2158 - Add warning message when a product cannot be delivered to an address

This commit is contained in:
mDeflotte
2012-05-03 08:10:09 +00:00
parent f35a7fe4b2
commit e02e6238c8
9 changed files with 99 additions and 33 deletions
+10 -3
View File
@@ -238,9 +238,16 @@ class OrderControllerCore extends ParentOrderController
$this->context->cart->setNoMultishipping();
// Add checking for all addresses
if (!Tools::isSubmit('id_address_delivery') || !Address::isCountryActiveById((int)Tools::getValue('id_address_delivery')))
$this->errors[] = Tools::displayError('This address is not in a valid area.');
$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.'));
elseif ($this->context->cart->isMultiAddressDelivery())
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to one of the address you selected.'));
else
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to the address you selected.'));
}
else
{
$this->context->cart->id_address_delivery = (int)Tools::getValue('id_address_delivery');