diff --git a/usps_api_bridge.php b/usps_api_bridge.php index 8d73353..054bf04 100644 --- a/usps_api_bridge.php +++ b/usps_api_bridge.php @@ -15,7 +15,7 @@ class Usps_Api_Bridge extends Module { $this->name = 'usps_api_bridge'; $this->tab = 'shipping_logistics'; - $this->version = '1.0.1'; + $this->version = '1.0.2'; $this->author = 'Panariga'; $this->need_instance = 0; $this->bootstrap = true; @@ -219,8 +219,12 @@ class Usps_Api_Bridge extends Module if (!empty($params->id_address_delivery)) { $address = new Address($params->id_address_delivery); if (Validate::isLoadedObject($address)) { - $destZip = $address->postcode; - $destCountryIso = Country::getIsoById($address->id_country); + if (!empty($address->postcode)) { + $destZip = $address->postcode; + } + if (!empty($address->id_country)) { + $destCountryIso = Country::getIsoById($address->id_country); + } } } @@ -241,6 +245,9 @@ class Usps_Api_Bridge extends Module } if (empty($destZip)) { + $this->externalLog([ + 'destZip' => 'is empty', + ]); return false; }