• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/base.php
  • Класс: BitrixIblockComponentBase
  • Вызов: Base::initPrices
protected function initPrices()
{
	// This function returns array with prices description and access rights
	// in case catalog module n/a prices get values from element properties
	$this->storage['PRICES'] = CIBlockPriceTools::GetCatalogPrices(
		isset($this->arParams['IBLOCK_ID']) && $this->arParams['IBLOCK_ID'] > 0 ? $this->arParams['IBLOCK_ID'] : false,
		$this->arParams['PRICE_CODE']
	);
	$this->storage['PRICES_ALLOW'] = CIBlockPriceTools::GetAllowCatalogPrices($this->storage['PRICES']);
	$this->storage['PRICES_CAN_BUY'] = array();
	$this->storage['PRICES_MAP'] = array();
	foreach ($this->storage['PRICES'] as $priceType)
	{
		$this->storage['PRICES_MAP'][$priceType['ID']] = $priceType['CODE'];
		if ($priceType['CAN_BUY'])
			$this->storage['PRICES_CAN_BUY'][$priceType['ID']] = $priceType['ID'];
	}

	$this->storage['PRICE_TYPES'] = array();
	if ($this->useCatalog)
		$this->storage['PRICE_TYPES'] = CCatalogGroup::GetListArray();

	$this->useDiscountCache = false;
	if ($this->useCatalog)
	{
		if (!empty($this->storage['CATALOGS']) && !empty($this->storage['PRICES_ALLOW']))
			$this->useDiscountCache = true;
	}

	if ($this->useCatalog && $this->useDiscountCache)
	{
		$this->useDiscountCache = CIBlockPriceTools::SetCatalogDiscountCache(
			$this->storage['PRICES_ALLOW'],
			$this->getUserGroups()
		);
	}

	if ($this->useCatalog)
		CatalogProductPrice::loadRoundRules($this->storage['PRICES_ALLOW']);
}