1
0
mirror of synced 2024-11-22 13:26:10 +03:00

Merge pull request #86 from Frosin/master

fixed service bug
This commit is contained in:
Alex Lushpai 2019-10-17 11:41:01 +03:00 committed by GitHub
commit defebe6439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1009,11 +1009,14 @@ class RetailCrmHistory
if (isset($orderCrm['delivery']['service']['code'])) { if (isset($orderCrm['delivery']['service']['code'])) {
$deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId); $deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId);
$serviceCode = $orderCrm['delivery']['service']['code']; $serviceCode = $orderCrm['delivery']['service']['code'];
$services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); $service = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId);
if (is_object($service)) {
$services = $service->getProfilesList();
if (!array_key_exists($serviceCode, $services)) { if (!array_key_exists($serviceCode, $services)) {
$serviceCode = strtoupper($serviceCode); $serviceCode = strtoupper($serviceCode);
$serviceCode = str_replace(array('-'), "_", $serviceCode); $serviceCode = str_replace(array('-'), "_", $serviceCode);
} }
}
if ($deliveryCode) { if ($deliveryCode) {
try { try {
$deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode); $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode);