• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/discount.php
  • Класс: BitrixCatalogDiscountTable
  • Вызов: DiscountTable::setUseCoupons
static function setUseCoupons($discountList, $use)
{
	if (!is_array($discountList))
		$discountList = array($discountList);
	$use = (string)$use;
	if ($use !== 'Y' && $use !== 'N')
		return;
	MainTypeCollection::normalizeArrayValuesByInt($discountList);
	if (empty($discountList))
		return;
	$conn = MainApplication::getConnection();
	$helper = $conn->getSqlHelper();
	$conn->queryExecute(
		'update '.$helper->quote(self::getTableName()).
		' set '.$helper->quote('USE_COUPONS').' = ''.$use.'' where '.
		$helper->quote('ID').' in ('.implode(',', $discountList).')'
	);
	unset($helper, $conn);
}