• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/discount/discountmanager.php
  • Класс: BitrixCatalogDiscountDiscountManager
  • Вызов: DiscountManager::preloadPriceData
static function preloadPriceData(array $productIds, array $catalogGroups)
{
	if (empty($productIds) || empty($catalogGroups))
		return;
	Collection::normalizeArrayValuesByInt($productIds);
	if (empty($productIds))
		return;
	Collection::normalizeArrayValuesByInt($catalogGroups);
	if (empty($catalogGroups))
		return;

	$productIds = self::extendProductIdsToOffer($productIds);

	foreach($productIds as $i => $productId)
	{
		if(isset(self::$preloadedPriceData[$productId]))
		{
			unset($productIds[$i]);
		}
	}

	if(empty($productIds))
	{
		return;
	}

	$dbPrice = CatalogPriceTable::getList([
		'select' => ['*'],
		'filter' => ['@PRODUCT_ID' => $productIds, '@CATALOG_GROUP_ID' => $catalogGroups]
	]);
	while($priceRow = $dbPrice->fetch())
	{
		self::$preloadedPriceData[$priceRow['PRODUCT_ID'].'-'.$priceRow['CATALOG_GROUP_ID']] = $priceRow;
	}
}