• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/preset/basepreset.php
  • Класс: BitrixSaleDiscountPresetBasePreset
  • Вызов: BasePreset::getAllowableUserGroups
protected function getAllowableUserGroups()
{
	$groupList = [];

	if ($this->isRestrictedGroupsModeEnabled())
	{
		if (MainLoader::includeModule('crm'))
		{
			foreach (BuyerGroup::getPublicList() as $group)
			{
				$groupList[$group['ID']] = $group['NAME'];
			}
		}
	}
	else
	{
		$groupIterator = MainGroupTable::getList([
			'select' => ['ID', 'NAME'],
			'order' => ['C_SORT' => 'ASC', 'ID' => 'ASC'],
		]);
		while ($group = $groupIterator->fetch())
		{
			$groupList[$group['ID']] = $group['NAME'];
		}
	}

	return $groupList;
}