Skip to content

Commit

Permalink
ref #89248 Исправлена ошибка при изменении торгового предложения в то…
Browse files Browse the repository at this point in the history
…варе (#299)
  • Loading branch information
uryvskiy-dima authored Jun 12, 2023
1 parent ce5ea1f commit 7a2ab16
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2023-06-12 v.6.3.14
- Исправлена ошибка при изменении торгового предложения в товаре

## 2023-06-09 v.6.3.13
- Правка генерации при работе со значением Без НДС

Expand Down
7 changes: 4 additions & 3 deletions intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public static function orderSend(

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'];
Expand Down Expand Up @@ -223,12 +224,12 @@ public static function orderSend(
) {
$externalIds[$keyBasketId] = [
'code' => 'bitrixBasketId',
'value' => $product['ID'],
'value' => $product['ID'] . '#' . $externalId,
];
} else {
$externalIds[] = [
'code' => 'bitrixBasketId',
'value' => $product['ID'],
'value' => $product['ID'] . '#' . $externalId,
];
}
} else { //create
Expand All @@ -239,7 +240,7 @@ public static function orderSend(
],
[
'code' => 'bitrixBasketId',
'value' => $product['ID'],
'value' => $product['ID'] . '#' . $externalId,
],
];
}
Expand Down
2 changes: 1 addition & 1 deletion intaro.retailcrm/description.ru
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Правка генерации при работе со значением Без НДС
- Исправлена ошибка при изменении торгового предложения в товаре
4 changes: 2 additions & 2 deletions intaro.retailcrm/install/version.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$arModuleVersion = [
'VERSION' => '6.3.13',
'VERSION_DATE' => '2023-06-09 15:00:00'
'VERSION' => '6.3.14',
'VERSION_DATE' => '2023-06-12 20:00:00'
];
4 changes: 3 additions & 1 deletion intaro.retailcrm/lib/service/orderloyaltydataservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ public function updateOrderFromCrm(int $orderId): void
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;
Expand Down

0 comments on commit 7a2ab16

Please sign in to comment.