From f41d04fb0e0111b2f17d2094d8fdbe2ce1ce4205 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 18 Apr 2019 09:51:26 +0300 Subject: [PATCH] fixed delivery service bug --- .../classes/general/history/RetailCrmHistory_v5.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index 9e2d7745..568bd27e 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -994,12 +994,12 @@ 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); - } + $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); + } if ($deliveryCode) { try { $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode);