From fa706de2e1aae01b792b0a3a319930688ed89624 Mon Sep 17 00:00:00 2001 From: gorokh Date: Mon, 1 Jul 2019 14:38:11 +0300 Subject: [PATCH 1/2] Fixed sending empty order when deleting order from CMS --- CHANGELOG.md | 3 +++ .../classes/general/events/RetailCrmEvent.php | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f03bfde..308926bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2019-07-01 v.2.4.8 +* Исправлена отправка пустого заказа при удалении заказа из СMS + ## 2019-03-28 v.2.4.7 * Добавлено удаление в системе типа цены у товара для неактивного типа цены на сайте diff --git a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php index 82cd9bd1..fc924dd3 100644 --- a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php +++ b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php @@ -65,6 +65,13 @@ class RetailCrmEvent $GLOBALS['RETAILCRM_ORDER_OLD_EVENT'] = true; + if (($arFields['CANCELED'] == 'Y') + && (sizeof($arFields['BASKET_ITEMS']) == 0 ) + && (sizeof($arFields['ORDER_PROP']) == 0 ) + ) { + $GLOBALS['ORDER_DELETE_USER_ADMIN'] = true; + } + return; } @@ -88,6 +95,10 @@ class RetailCrmEvent */ function orderSave($event) { + if (true == $GLOBALS['ORDER_DELETE_USER_ADMIN']) { + return false; + } + if ($GLOBALS['RETAILCRM_ORDER_OLD_EVENT'] === false && $GLOBALS['RETAIL_CRM_HISTORY'] === true && $GLOBALS['RETAILCRM_ORDER_DELETE'] === true From 58f4ed739d69922c42f83439ca6a7df201da507a Mon Sep 17 00:00:00 2001 From: gorokh Date: Mon, 1 Jul 2019 14:59:29 +0300 Subject: [PATCH 2/2] fix travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 632a4db4..b6a84236 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: php sudo: false +services: + - mysql + php: - 7.1 - 7.2