From 9e5b1ba2d8c6e496ad53893090875d105bd109f5 Mon Sep 17 00:00:00 2001 From: Frosin Date: Thu, 11 Jul 2019 10:56:24 +0300 Subject: [PATCH] fixed synchronization when removing or adding products in retailCRM --- .../system/library/retailcrm/RetailcrmHistoryHelper.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/upload/system/library/retailcrm/RetailcrmHistoryHelper.php b/src/upload/system/library/retailcrm/RetailcrmHistoryHelper.php index 23522d4..8a08e17 100644 --- a/src/upload/system/library/retailcrm/RetailcrmHistoryHelper.php +++ b/src/upload/system/library/retailcrm/RetailcrmHistoryHelper.php @@ -41,15 +41,13 @@ class RetailcrmHistoryHelper { $orders[$change['order']['id']]['items'][$change['item']['id']] = $change['item']; } - if (isset($change['oldValue']) - && empty($change['oldValue']) + if (empty($change['oldValue']) && $change['field'] == 'order_product' ) { $orders[$change['order']['id']]['items'][$change['item']['id']]['create'] = true; } - if (isset($change['newValue']) - && empty($change['newValue']) + if (empty($change['newValue']) && $change['field'] == 'order_product' ) { $orders[$change['order']['id']]['items'][$change['item']['id']]['delete'] = true;