1
0
Fork 0
mirror of synced 2025-04-04 14:23:33 +03:00

ref #91040 передача подписки клиена при его регистрации через заказ

This commit is contained in:
Ivan Chaplygin 2023-07-17 14:47:11 +03:00
parent 6aeaaf8bd3
commit 2c638fca90

View file

@ -463,9 +463,13 @@ class RetailCrmHistory
$corporateCustomerBuilder->setCorporateContact($userData);
$newUser = new CUser();
$registeredUserID = $newUser->Add(
$corporateCustomerBuilder->getCustomer()->getObjectToArray()
);
$customerArray = $corporateCustomerBuilder->getCustomer()->getObjectToArray();
if (!array_key_exists('UF_SUBSCRIBE_USER_EMAIL', $customerArray)) {
$customerArray['UF_SUBSCRIBE_USER_EMAIL'] = 'Y';
}
$registeredUserID = $newUser->Add(self::convertBooleanFields($customerArray));
if ($registeredUserID === false) {
RCrmActions::eventLog(
@ -927,9 +931,14 @@ class RetailCrmHistory
}
if ($registerNewUser === true) {
$registeredUserID = $newUser->Add(
$customerBuilder->getCustomer()->getObjectToArray()
);
$customerArray = $customerBuilder->getCustomer()->getObjectToArray();
if (!array_key_exists('UF_SUBSCRIBE_USER_EMAIL', $customerArray)) {
$customerArray['UF_SUBSCRIBE_USER_EMAIL'] = 'Y';
}
$registeredUserID = $newUser->Add(self::convertBooleanFields($customerArray));
if ($registeredUserID === false) {
RCrmActions::eventLog(
'RetailCrmHistory::orderHistory',