Answer the question
In order to leave comments, you need to log in
Why are discounts assigned to a certain group of users not available to users who got into this group through the Bitrix API?
Good evening!
Through the admin panel, I assign the “Professionals Club” group to the user.
I see discounts:
If I add via the API:
$dbGroup = \Bitrix\Main\UserGroupTable::getList(
array(
'filter' => array("USER_ID" => $USER->GetID(), "GROUP_ID" => 8)
)
);
$arGroups = $dbGroup->FetchAll();
if (empty($arGroups) && $arGroups[0]["GROUP_ID"] !== 8) {
\Bitrix\Main\UserGroupTable::add(
array(
'USER_ID' => $USER->GetID(),
'GROUP_ID' => 8,
)
);
Answer the question
In order to leave comments, you need to log in
If I click on the "Exit" button, and then log back in, discounts appear.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question