CatalogBuilder::setCatalog

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. CatalogBuilder
  4. setCatalog
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/url/adminpage/catalogbuilder.php
  • Класс: BitrixCatalogUrlAdminPageCatalogBuilder
  • Вызов: CatalogBuilder::setCatalog
protected function setCatalog()
	{
		$this->catalog = CCatalogSku::GetInfoByIBlock($this->iblockId);
		if ($this->catalog === false)
		{
			$this->catalog = null;
		}
		if (empty($this->catalog))
		{
			$this->catalogType = null;
			$this->setTemplateVariable('#PRODUCT_IBLOCK_ID#', '');
			$this->setTemplateVariable('#OFFER_IBLOCK_ID#', '');
		}
		else
		{
			$this->catalogType = $this->catalog['CATALOG_TYPE'];
			$productIblockId = '';
			$offerIblockId = '';
			switch ($this->catalogType)
			{
				case CCatalogSku::TYPE_CATALOG:
					$productIblockId = $this->catalog['IBLOCK_ID'];
					break;
				case CCatalogSku::TYPE_OFFERS:
				case CCatalogSku::TYPE_FULL:
				case CCatalogSku::TYPE_PRODUCT:
					$productIblockId = $this->catalog['PRODUCT_IBLOCK_ID'];
					$offerIblockId = $this->catalog['IBLOCK_ID'];
					break;
			}
			$this->setTemplateVariable('#PRODUCT_IBLOCK_ID#', $productIblockId);
			$this->setTemplateVariable('#OFFER_IBLOCK_ID#', $offerIblockId);
			unset($offerIblockId, $productIblockId);
		}
	}

Добавить комментарий