コード例 #1
0
 if (!$boolConvert) {
     $strBaseCurrency = CCurrency::GetBaseCurrency();
 }
 $catalogs = array();
 foreach ($arResult['CATALOGS'] as $catalog) {
     $offersCatalogId = (int) $catalog['OFFERS_IBLOCK_ID'];
     $offersPropId = (int) $catalog['OFFERS_PROPERTY_ID'];
     $catalogId = (int) $catalog['IBLOCK_ID'];
     $sku = false;
     if ($offersCatalogId > 0 && $offersPropId > 0) {
         $sku = array("IBLOCK_ID" => $offersCatalogId, "SKU_PROPERTY_ID" => $offersPropId, "PRODUCT_IBLOCK_ID" => $catalogId);
     }
     if (!empty($sku) && is_array($sku)) {
         $skuPropList[$catalogId] = CIBlockPriceTools::getTreeProperties($sku, $arParams['OFFER_TREE_PROPS'][$offersCatalogId], array('PICT' => $arEmptyPreview, 'NAME' => '-'));
         $needValues = array();
         CIBlockPriceTools::getTreePropertyValues($skuPropList[$catalogId], $needValues);
         $skuPropIds[$catalogId] = array_keys($skuPropList[$catalogId]);
         if (!empty($skuPropIds[$catalogId])) {
             $skuPropKeys[$catalogId] = array_fill_keys($skuPropIds[$catalogId], false);
         }
     }
 }
 $arNewItemsList = array();
 foreach ($arResult['ITEMS'] as $key => $arItem) {
     $arItem['CATALOG_QUANTITY'] = 0 < $arItem['CATALOG_QUANTITY'] && is_float($arItem['CATALOG_MEASURE_RATIO']) ? floatval($arItem['CATALOG_QUANTITY']) : intval($arItem['CATALOG_QUANTITY']);
     $arItem['CATALOG'] = false;
     $arItem['LABEL'] = false;
     if (!isset($arItem['CATALOG_SUBSCRIPTION']) || 'Y' != $arItem['CATALOG_SUBSCRIPTION']) {
         $arItem['CATALOG_SUBSCRIPTION'] = 'N';
     }
     // Item Label Properties
コード例 #2
0
 $arSKUPropList = array();
 $arSKUPropIDs = array();
 $arSKUPropKeys = array();
 $boolSKU = false;
 $strBaseCurrency = '';
 $boolConvert = isset($arResult['CONVERT_CURRENCY']['CURRENCY_ID']);
 if ($arResult['MODULES']['catalog']) {
     if (!$boolConvert) {
         $strBaseCurrency = CCurrency::GetBaseCurrency();
     }
     $arSKU = CCatalogSKU::GetInfoByProductIBlock($arParams['IBLOCK_ID']);
     $boolSKU = !empty($arSKU) && is_array($arSKU);
     if ($boolSKU && !empty($arParams['OFFER_TREE_PROPS']) && 'Y' == $arParams['PRODUCT_DISPLAY_MODE']) {
         $arSKUPropList = CIBlockPriceTools::getTreeProperties($arSKU, $arParams['OFFER_TREE_PROPS'], array('PICT' => $arEmptyPreview, 'NAME' => '-'));
         $arNeedValues = array();
         CIBlockPriceTools::getTreePropertyValues($arSKUPropList, $arNeedValues);
         $arSKUPropIDs = array_keys($arSKUPropList);
         if (empty($arSKUPropIDs)) {
             $arParams['PRODUCT_DISPLAY_MODE'] = 'N';
         } else {
             $arSKUPropKeys = array_fill_keys($arSKUPropIDs, false);
         }
     }
 }
 $arNewItemsList = array();
 foreach ($arResult['ITEMS'] as $key => $arItem) {
     $arItem['CHECK_QUANTITY'] = false;
     if (!isset($arItem['CATALOG_MEASURE_RATIO'])) {
         $arItem['CATALOG_MEASURE_RATIO'] = 1;
     }
     if (!isset($arItem['CATALOG_QUANTITY'])) {