From 18a10bf91653d00083cd2b88b7a26bf043312fcd Mon Sep 17 00:00:00 2001 From: Uryvskiy Dima Date: Fri, 8 Dec 2023 12:27:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=80=D0=B5=D0=BA=D0=BB=D0=B0=D0=BC=D0=BD=D0=BE?= =?UTF-8?q?-=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=BE?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B5=20=D1=80=D0=B0=D1=81=D1=81=D1=8B=D0=BB?= =?UTF-8?q?=D0=BA=D0=B8=20(#324)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ README.md | 2 +- intaro.retailcrm/classes/general/events/RetailCrmEvent.php | 7 ++++--- intaro.retailcrm/classes/general/user/RetailCrmUser.php | 5 +++-- intaro.retailcrm/install/version.php | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 236ea421..f98d2450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-10-25 v.6.4.11 +- Исправлена ошибка при передаче подписки на рекламно-информационные рассылки + ## 2023-10-25 v.6.4.10 - Добавлена передача трек-номера в заказе из CRM в Bitrix diff --git a/README.md b/README.md index ca7e26fe..55954be1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Build Status](https://github.com/retailcrm/bitrix-module/workflows/ci/badge.svg)](https://github.com/retailcrm/bitrix-module/actions) [![GitHub release](https://img.shields.io/github/release/retailcrm/bitrix-module.svg?logo=github)](https://github.com/retailcrm/bitrix-module/releases) [![Coverage](https://img.shields.io/codecov/c/gh/retailcrm/bitrix-module/master.svg?logo=codecov)](https://codecov.io/gh/retailcrm/bitrix-module) -[![PHP version](https://img.shields.io/badge/PHP->=7.4-blue.svg?logo=php)](https://php.net/) +[![PHP version](https://img.shields.io/badge/PHP->=8.0-blue.svg?logo=php)](https://php.net/) Bitrix module ============= diff --git a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php index e4653199..4026fab6 100644 --- a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php +++ b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php @@ -287,7 +287,7 @@ class RetailCrmEvent $userCrm = RCrmActions::apiMethod($api, 'customersGet', __METHOD__, $arOrder['USER_ID'], $site); if (!isset($userCrm['customer'])) { - $arUser = UserTable::getById($arOrder['USER_ID'])->fetch(); + $arUser = CUser::GetByID($arOrder['USER_ID'])->Fetch(); if (!empty($address)) { $arUser['PERSONAL_STREET'] = $address; @@ -412,7 +412,8 @@ class RetailCrmEvent $userCrm = RCrmActions::apiMethod($api, 'customersGet', __METHOD__, $arOrder['USER_ID'], $site); if (!isset($userCrm['customer'])) { - $arUser = Bitrix\Main\UserTable::getById($arOrder['USER_ID'])->fetch(); + $arUser = CUser::GetByID($arOrder['USER_ID'])->Fetch(); + $resultUser = RetailCrmUser::customerSend( $arUser, $api, @@ -429,7 +430,7 @@ class RetailCrmEvent ); return null; - }http://localhost/personal/cart/ + } } } diff --git a/intaro.retailcrm/classes/general/user/RetailCrmUser.php b/intaro.retailcrm/classes/general/user/RetailCrmUser.php index 2572e228..0561eeb9 100644 --- a/intaro.retailcrm/classes/general/user/RetailCrmUser.php +++ b/intaro.retailcrm/classes/general/user/RetailCrmUser.php @@ -48,8 +48,9 @@ class RetailCrmUser $normalizer = new RestNormalizer(); $customer = $normalizer->normalize($customer, 'customers'); - if (empty($arFields['UF_SUBSCRIBE_USER_EMAIL'])) { - $customer['subscribed'] = false; + if (array_key_exists('UF_SUBSCRIBE_USER_EMAIL', $arFields)) { + // UF_SUBSCRIBE_USER_EMAIL = '1' or '0' + $customer['subscribed'] = (bool) $arFields['UF_SUBSCRIBE_USER_EMAIL']; } Logger::getInstance()->write($customer, 'customerSend'); diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 57f54389..4db47efb 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.4.10', - 'VERSION_DATE' => '2023-10-25 15:00:00' + 'VERSION' => '6.4.11', + 'VERSION_DATE' => '2023-12-08 13:00:00' ];