update estimator logic

This commit is contained in:
O K
2026-01-21 09:59:16 +02:00
parent 7601859990
commit adc581282f

View File

@@ -15,7 +15,7 @@ class Usps_Api_Bridge extends Module
{ {
$this->name = 'usps_api_bridge'; $this->name = 'usps_api_bridge';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.0.1'; $this->version = '1.0.2';
$this->author = 'Panariga'; $this->author = 'Panariga';
$this->need_instance = 0; $this->need_instance = 0;
$this->bootstrap = true; $this->bootstrap = true;
@@ -219,10 +219,14 @@ class Usps_Api_Bridge extends Module
if (!empty($params->id_address_delivery)) { if (!empty($params->id_address_delivery)) {
$address = new Address($params->id_address_delivery); $address = new Address($params->id_address_delivery);
if (Validate::isLoadedObject($address)) { if (Validate::isLoadedObject($address)) {
if (!empty($address->postcode)) {
$destZip = $address->postcode; $destZip = $address->postcode;
}
if (!empty($address->id_country)) {
$destCountryIso = Country::getIsoById($address->id_country); $destCountryIso = Country::getIsoById($address->id_country);
} }
} }
}
if (empty($destZip) && isset($context->cookie->postcode)) { if (empty($destZip) && isset($context->cookie->postcode)) {
$destZip = $context->cookie->postcode; $destZip = $context->cookie->postcode;
@@ -241,6 +245,9 @@ class Usps_Api_Bridge extends Module
} }
if (empty($destZip)) { if (empty($destZip)) {
$this->externalLog([
'destZip' => 'is empty',
]);
return false; return false;
} }