SetTitle("Прайс-лист"); ?>SetAdditionalCSS(SITE_TEMPLATE_PATH . "/css/price_list.css"); $iblockID = 21; $result = array(); $arConvertParams = array(); $arCatalogPrices = CIBlockPriceTools::GetCatalogPrices($iblockID, array('BASE')); $obCache = new CPHPCache(); $strCacheID = serialize(array($iblockID, $rz_b2_options['active-currency'], $arConvertParams, $arCatalogPrices)); if ( ! $obCache->InitCache(36000, $strCacheID, "/catalog/price_list")) { if ($obCache->StartDataCache()) { if ($rz_b2_options['currency-switcher'] == 'Y') { $strCurrencyID = $rz_b2_options['active-currency']; $bConvertCurrency = 'Y'; $arConvertParams = array(); $currencyIterator = CurrencyTable::getList(array( 'select' => array('CURRENCY'), 'filter' => array('=CURRENCY' => $strCurrencyID) )); if ($currency = $currencyIterator->fetch()) { $strCurrencyID = $currency['CURRENCY']; $arConvertParams['CURRENCY_ID'] = $currency['CURRENCY']; } } $rsSection = CIBlockSection::GetList( array('left_margin' => 'asc'), array( 'IBLOCK_ID' => $iblockID, 'ACTIVE' => 'Y', 'GLOBAL_ACTIVE' => 'Y', ), false, array('ID', 'NAME', 'IBLOCK_SECTION_ID', 'SECTION_PAGE_URL', 'DEPTH_LEVEL') ); while ($arSection = $rsSection->GetNext()) { // некоторые элементы привязаны к нескольким разделам // ciblockelement::getlist возвращает лишь один $rsElement = CIBlockElement::GetList( array('name' => 'asc'), array( 'IBLOCK_ID' => $iblockID, 'ACTIVE' => 'Y', 'GLOBAL_ACTIVE' => 'Y', 'SECTION_ID' => $arSection['ID'], ), false, false, array('ID', 'NAME', 'DETAIL_PAGE_URL', $arCatalogPrices['BASE']['SELECT']) ); while ($arElement = $rsElement->GetNext()) { if ($rz_b2_options['currency-switcher'] == 'Y') { $arElement["PRICES"] = array(); $arElement["PRICES"] = CIBlockPriceTools::GetItemPrices($iblockID, $arCatalogPrices, $arElement, 'N', $arConvertParams); } $result['elements'][$arElement['ID']] = $arElement; $arSection['elements'][$arElement['ID']] = $arElement['ID']; } $result['sections'][$arSection['ID']] = $arSection; } if (defined("BX_COMP_MANAGED_CACHE")) { $CACHE_MANAGER->StartTagCache("/iblock/catalog"); $CACHE_MANAGER->RegisterTag("iblock_id_{$iblockID}"); $CACHE_MANAGER->EndTagCache(); } $obCache->EndDataCache($result); } } else { $result = $obCache->GetVars(); } ?>
Наименование Цена