From 80e9a279f1aed5c00258a41c3247d3cdb277ee3c Mon Sep 17 00:00:00 2001 From: Frosin Date: Tue, 8 Oct 2019 16:23:18 +0300 Subject: [PATCH] fixed service bug --- .../classes/general/history/RetailCrmHistory_v5.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index b064776f..62156352 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -1004,10 +1004,13 @@ class RetailCrmHistory if (isset($orderCrm['delivery']['service']['code'])) { $deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId); $serviceCode = $orderCrm['delivery']['service']['code']; - $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); - if (!array_key_exists($serviceCode, $services)) { - $serviceCode = strtoupper($serviceCode); - $serviceCode = str_replace(array('-'), "_", $serviceCode); + $service = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId); + if (is_object($service)) { + $services = $service->getProfilesList(); + if (!array_key_exists($serviceCode, $services)) { + $serviceCode = strtoupper($serviceCode); + $serviceCode = str_replace(array('-'), "_", $serviceCode); + } } if ($deliveryCode) { try {