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' ];