diff --git a/dpdbaltics.php b/dpdbaltics.php index 9043978..dbe0b54 100644 --- a/dpdbaltics.php +++ b/dpdbaltics.php @@ -1100,7 +1100,7 @@ public function printLabel($idShipment) if ($parcelPrintResponse->getStatus() === Config::API_SUCCESS_STATUS) { $this->updateOrderCarrier($idShipment); - return; + return $parcelPrintResponse; } return $parcelPrintResponse; @@ -1117,7 +1117,7 @@ public function printMultipleLabels($shipmentIds) foreach ($shipmentIds as $shipmentId) { $this->updateOrderCarrier($shipmentId); } - return; + return $parcelPrintResponse; } return $parcelPrintResponse; @@ -1358,7 +1358,7 @@ private function handleLabelPrintService() return; } - if (!empty($parcelPrintResponse->getErrLog())) { + if (isset($parcelPrintResponse) && !empty($parcelPrintResponse->getErrLog())) { Context::getContext()->controller->errors[] = $parcelPrintResponse->getErrLog(); } @@ -1383,7 +1383,7 @@ private function handleLabelPrintService() return; } - if (!empty($parcelPrintResponse->getErrLog())) { + if (isset($parcelPrintResponse) && !empty($parcelPrintResponse->getErrLog())) { Context::getContext()->controller->errors[] = $parcelPrintResponse->getErrLog(); }