• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/base.php
  • Класс: BitrixIblockComponentBase
  • Вызов: Base::processOffers
protected function processOffers()
{
	if ($this->useCatalog && !empty($this->iblockProducts))
	{
		$offers = array();

		$paramStack = array();
		$enableCompatible = $this->isEnableCompatible();
		if ($enableCompatible)
		{
			$paramStack['USE_PRICE_COUNT'] = $this->arParams['USE_PRICE_COUNT'];
			$paramStack['SHOW_PRICE_COUNT'] = $this->arParams['SHOW_PRICE_COUNT'];
			$this->arParams['USE_PRICE_COUNT'] = false;
			$this->arParams['SHOW_PRICE_COUNT'] = 1;
		}

		foreach (array_keys($this->iblockProducts) as $iblock)
		{
			if (!empty($this->productWithOffers[$iblock]))
			{
				$iblockOffers = $this->getIblockOffers($iblock);
				if (!empty($iblockOffers))
				{
					$offersId = array_keys($iblockOffers);
					$this->initItemsMeasure($iblockOffers);
					$this->loadMeasures($this->getMeasureIds($iblockOffers));

					$this->loadPrices($offersId);
					$this->calculateItemPrices($iblockOffers);

					$this->transferItems($iblockOffers);

					$this->modifyOffers($iblockOffers);
					$this->chooseOffer($iblockOffers, $iblock);

					$offers = array_merge($offers, $iblockOffers);
				}
				unset($iblockOffers);
			}
		}
		if ($enableCompatible)
		{
			$this->arParams['USE_PRICE_COUNT'] = $paramStack['USE_PRICE_COUNT'];
			$this->arParams['SHOW_PRICE_COUNT'] = $paramStack['SHOW_PRICE_COUNT'];
		}
		unset($enableCompatible, $paramStack);
	}
}