diff --git a/CHANGELOG.md b/CHANGELOG.md index d64c9d10..7953b942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -197,6 +197,7 @@ - Fixed Lithuanian and Latvian translations for shipping label in admin order panel - Added Poland parcel shop import support with batch processing - Fixed null parameter deprecation in AddressAdapter preg_replace calls +- Improved pickup point import to warn when DPD returns 0 points and keep existing points instead of reporting a false success - Fixed shipment creation failing for accounts requiring Predict SMS service - Fixed additional validation for supercheckout module using currentcontroller variable - Fixed automatic PUDO point pre-selection in LIST mode diff --git a/src/Service/Import/API/ParcelShopImport.php b/src/Service/Import/API/ParcelShopImport.php index 26756353..759b9a9b 100644 --- a/src/Service/Import/API/ParcelShopImport.php +++ b/src/Service/Import/API/ParcelShopImport.php @@ -120,6 +120,23 @@ public function importParcelShops($selectedCountry) } $parcelCount = count($parcelShops); + + if ($parcelCount === 0) { + $this->logger->warning(sprintf( + '[ParcelImport] API returned 0 parcel shops for %s | API took: %ss', + $selectedCountry, + $apiTime + )); + + return [ + 'success' => false, + 'error' => sprintf( + $this->module->l('DPD returned 0 pickup points for %s. Existing pickup points were kept. The web service account may not be enabled for pickup point retrieval - please contact DPD.', self::FILE_NAME), + $selectedCountry + ) + ]; + } + $dbStartTime = microtime(true); try {