$arItem["PRICES"] = array(); $arItem["PRICE_MATRIX"] = false; $arItem['MIN_PRICE'] = false; if ($arParams["USE_PRICE_COUNT"]) { if ($bCatalog) { $arItem["PRICE_MATRIX"] = CatalogGetPriceTableEx($arItem["ID"], 0, $arPriceTypeID, 'Y', $arConvertParams); if (isset($arItem["PRICE_MATRIX"]["COLS"]) && is_array($arItem["PRICE_MATRIX"]["COLS"])) { foreach ($arItem["PRICE_MATRIX"]["COLS"] as $keyColumn => $arColumn) { $arItem["PRICE_MATRIX"]["COLS"][$keyColumn]["NAME_LANG"] = htmlspecialcharsbx($arColumn["NAME_LANG"]); } } } } else { $arItem["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["IBLOCK_ID"], $arResult["PRICES"], $arItem, $arParams['PRICE_VAT_INCLUDE'], $arConvertParams); if (!empty($arItem['PRICES'])) { $arItem['MIN_PRICE'] = CIBlockPriceTools::getMinPriceFromList($arItem['PRICES']); } } $arItem["CAN_BUY"] = CIBlockPriceTools::CanBuy($arParams["IBLOCK_ID"], $arResult["PRICES"], $arItem); $arItem['~BUY_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['~BUY_URL_TEMPLATE']); $arItem['BUY_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['BUY_URL_TEMPLATE']); $arItem['~ADD_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['~ADD_URL_TEMPLATE']); $arItem['ADD_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['ADD_URL_TEMPLATE']); $arItem['~SUBSCRIBE_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['~SUBSCRIBE_URL_TEMPLATE']); $arItem['SUBSCRIBE_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['SUBSCRIBE_URL_TEMPLATE']); if ($arParams['DISPLAY_COMPARE']) { $arItem['~COMPARE_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['~COMPARE_URL_TEMPLATE']); $arItem['COMPARE_URL'] = str_replace('#ID#', $arItem["ID"], $arResult['COMPARE_URL_TEMPLATE']); } if ('Y' == $arParams['CONVERT_CURRENCY']) { if ($arParams["USE_PRICE_COUNT"]) {
/** * set prices for all items * @return array currency list */ protected function setItemsPrices() { // Set items Prices foreach ($this->items as &$item) { $item["PRICES"] = array(); $item['MIN_PRICE'] = false; $item["CAN_BUY"] = false; $item['~BUY_URL'] = $this->urlTemplates['~BUY_URL_TEMPLATE'] . $item['ID']; $item['BUY_URL'] = $this->urlTemplates['BUY_URL_TEMPLATE'] . $item['ID']; $item['~ADD_URL'] = $this->urlTemplates['~ADD_URL_TEMPLATE'] . $item['ID']; $item['ADD_URL'] = $this->urlTemplates['ADD_URL_TEMPLATE'] . $item['ID']; $item['~COMPARE_URL'] = $this->urlTemplates['~COMPARE_URL_TEMPLATE'] . $item['ID']; $item['COMPARE_URL'] = $this->urlTemplates['COMPARE_URL_TEMPLATE'] . $item['ID']; $item['~SUBSCRIBE_URL'] = $this->urlTemplates['~SUBSCRIBE_URL_TEMPLATE'] . $item['ID']; $item['SUBSCRIBE_URL'] = $this->urlTemplates['SUBSCRIBE_URL_TEMPLATE'] . $item['ID']; if (!empty($item['OFFERS'])) { continue; } $item['PRICES'] = CIBlockPriceTools::GetItemPrices($item['IBLOCK_ID'], $this->data['CATALOG_PRICES'], $item, $this->arParams['PRICE_VAT_INCLUDE'], $this->data['CONVERT_CURRENCY']); $item['MIN_PRICE'] = CIBlockPriceTools::getMinPriceFromList($item['PRICES']); $item['CAN_BUY'] = CIBlockPriceTools::CanBuy($item['IBLOCK_ID'], $this->data['CATALOG_PRICES'], $item); } unset($item); }