From 5f7f234dd95a7f44cfcfdc4dfad6267a4998e93f Mon Sep 17 00:00:00 2001 From: Evgeniy-Goroh Date: Thu, 30 Apr 2020 11:56:43 +0300 Subject: [PATCH] fix rewriting item --- intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index 90071528..4d1d3f23 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -159,6 +159,7 @@ class RetailCrmOrder $externalId = $position . "_" . $product['PRODUCT_ID']; if (isset($orderItems[$externalId])) { //update $externalIds = $orderItems[$externalId]['externalIds']; + $itemId = $orderItems[$externalId]['id']; $key = array_search("bitrix", array_column($externalIds, 'code')); if ($externalIds[$key]['code'] == "bitrix") { $externalIds[$key] = array( @@ -189,6 +190,10 @@ class RetailCrmOrder 'productName' => $product['NAME'] ); + if (isset($itemId)) { + $item['id'] = $itemId; + } + $pp = CCatalogProduct::GetByID($product['PRODUCT_ID']); if (is_null($pp['PURCHASING_PRICE']) == false) { if ($pp['PURCHASING_CURRENCY'] && $currency != $pp['PURCHASING_CURRENCY']) {