• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/base.php
  • Класс: BitrixIblockComponentBase
  • Вызов: Base::getBestSellersRecommendation
protected function getBestSellersRecommendation($ids)
{
	// increase element count
	$this->arParams['PAGE_ELEMENT_COUNT'] = $this->arParams['PAGE_ELEMENT_COUNT'] * 10;
	$bestsellers = $this->getBestSellersProductIds();
	$this->arParams['PAGE_ELEMENT_COUNT'] = $this->arParams['PAGE_ELEMENT_COUNT'] / 10;

	if (!empty($bestsellers))
	{
		$recommendationId = 'bestsellers';
		$bestsellers = MainAnalyticsCatalog::getProductIdsByOfferIds($bestsellers);
		$bestsellers = $this->filterByParams($bestsellers, $this->arParams['FILTER_IDS']);

		foreach ($bestsellers as $id)
		{
			if (!isset($this->recommendationIdToProduct[$id]))
			{
				$this->recommendationIdToProduct[$id] = $recommendationId;
			}
		}

		$ids = array_unique(array_merge($ids, $bestsellers));
	}

	return $ids;
}