diff --git a/CHANGELOG.md b/CHANGELOG.md index da44246a..3f935322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-06-12 v.6.3.14 +- Исправлена ошибка при изменении торгового предложения в товаре + ## 2023-06-09 v.6.3.13 - Правка генерации при работе со значением Без НДС diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index bb6562ed..21d0e7c4 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -180,6 +180,7 @@ class RetailCrmOrder if ('ordersEdit' === $methodApi) { $response = RCrmActions::apiMethod($api, 'ordersGet', __METHOD__, $order['externalId'], $site); + if (isset($response['order'])) { foreach ($response['order']['items'] as $k => $item) { $externalId = $k .'_'. $item['offer']['externalId']; @@ -223,12 +224,12 @@ class RetailCrmOrder ) { $externalIds[$keyBasketId] = [ 'code' => 'bitrixBasketId', - 'value' => $product['ID'], + 'value' => $product['ID'] . '#' . $externalId, ]; } else { $externalIds[] = [ 'code' => 'bitrixBasketId', - 'value' => $product['ID'], + 'value' => $product['ID'] . '#' . $externalId, ]; } } else { //create @@ -239,7 +240,7 @@ class RetailCrmOrder ], [ 'code' => 'bitrixBasketId', - 'value' => $product['ID'], + 'value' => $product['ID'] . '#' . $externalId, ], ]; } diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index f23752de..a8c09c58 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Правка генерации при работе со значением Без НДС \ No newline at end of file +- Исправлена ошибка при изменении торгового предложения в товаре \ No newline at end of file diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index e749f77f..d04c2c01 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.3.13', - 'VERSION_DATE' => '2023-06-09 15:00:00' + 'VERSION' => '6.3.14', + 'VERSION_DATE' => '2023-06-12 20:00:00' ]; diff --git a/intaro.retailcrm/lib/service/orderloyaltydataservice.php b/intaro.retailcrm/lib/service/orderloyaltydataservice.php index 898b9846..e65f871c 100644 --- a/intaro.retailcrm/lib/service/orderloyaltydataservice.php +++ b/intaro.retailcrm/lib/service/orderloyaltydataservice.php @@ -199,7 +199,9 @@ class OrderLoyaltyDataService array_column($itemArray['externalIds'], 'code'), true ); - $basketItem = $basket->getItemById($item->externalIds[$basketIdKey]->value); + + $basketId = explode('#', $item->externalIds[$basketIdKey]->value)[0] ?? null; + $basketItem = $basket->getItemById($basketId); if ($basketItem === null) { continue;