diff --git a/classes/Carrier.php b/classes/Carrier.php index db8243b2b..c29cfd16f 100644 --- a/classes/Carrier.php +++ b/classes/Carrier.php @@ -1057,9 +1057,17 @@ class CarrierCore extends ObjectModel if (empty($carrier_list)) // No carriers defined, get all available carriers { $carrier_list = array(); - $id_address = (!is_null($id_address_delivery) && $id_address_delivery != 0) ? $id_address_delivery : Context::getContext()->cart->id_address_delivery; - $address = new Address($id_address); - $id_zone = Address::getZoneById($address->id); + $id_address = (int)((!is_null($id_address_delivery) && $id_address_delivery != 0) ? $id_address_delivery : Context::getContext()->cart->id_address_delivery); + if ($id_address) + { + $address = new Address($id_address); + $id_zone = Address::getZoneById($address->id); + } + else + { + $country = new Country(Context::getContext()->shop->getAddress()->id_country); + $id_zone = $country->id_zone; + } $carriers = Carrier::getCarriersForOrder($id_zone, Context::getContext()->customer->getGroups()); foreach ($carriers as $carrier) $carrier_list[] = $carrier['id_carrier']; diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index e41bea4f7..c2ed09c35 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -370,6 +370,7 @@ class OrderOpcControllerCore extends ParentOrderController $carriers = $this->context->cart->simulateCarriersOutput(); $this->context->smarty->assign(array( 'HOOK_EXTRACARRIER' => null, + 'HOOK_EXTRACARRIER_ADDR' => null, 'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array( 'carriers' => $carriers, 'checked' => $this->context->cart->simulateCarrierSelectedOutput(), diff --git a/themes/default/order-carrier.tpl b/themes/default/order-carrier.tpl index 4055b9cc8..8d442e67c 100644 --- a/themes/default/order-carrier.tpl +++ b/themes/default/order-carrier.tpl @@ -113,6 +113,7 @@ {if isset($address_collection[$id_address])} {l s='Choose a shipping option for the address: '}{$address_collection[$id_address]->alias} {else} + {l s='Choose a shipping option'} {/if}