当前位置: 首页>>代码示例>>PHP>>正文


PHP CIBlockPriceTools::GetItemPrices方法代码示例

本文整理汇总了PHP中CIBlockPriceTools::GetItemPrices方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockPriceTools::GetItemPrices方法的具体用法?PHP CIBlockPriceTools::GetItemPrices怎么用?PHP CIBlockPriceTools::GetItemPrices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIBlockPriceTools的用法示例。


在下文中一共展示了CIBlockPriceTools::GetItemPrices方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

 foreach ($ratioResult as $ratioProduct => $ratioData) {
     $arResult['ITEMS_RATIO'][$ratioProduct] = $ratioData['RATIO'];
 }
 unset($ratioProduct, $ratioData);
 $tagIblockList = array();
 $tagIblockList[$arResult['PRODUCT_IBLOCK_ID']] = $arResult['PRODUCT_IBLOCK_ID'];
 $tagIblockList[$arResult['ELEMENT_IBLOCK_ID']] = $arResult['ELEMENT_IBLOCK_ID'];
 $tagCurrencyList = array();
 $found = false;
 $itemsIterator = CIBlockElement::GetList(array(), array('ID' => $arSetItemsID), false, false, $select);
 while ($item = $itemsIterator->GetNext()) {
     $found = true;
     $item['ID'] = (int) $item['ID'];
     $item['IBLOCK_ID'] = (int) $item['IBLOCK_ID'];
     $tagIblockList[$item['IBLOCK_ID']] = $item['IBLOCK_ID'];
     $priceList = CIBlockPriceTools::GetItemPrices($item['IBLOCK_ID'], $arResult['PRICES'], $item, $arParams['PRICE_VAT_INCLUDE'], $arConvertParams);
     if (empty($priceList)) {
         continue;
     }
     //TODO: after iblock 15.5.9 change this code to CIBlockPriceTools::getMinPriceFromList
     foreach ($priceList as &$price) {
         $tagCurrencyList[$price['CURRENCY']] = $price['CURRENCY'];
         if (isset($price['ORIG_CURRENCY'])) {
             $tagCurrencyList[$price['ORIG_CURRENCY']] = $price['ORIG_CURRENCY'];
         }
         if ($price['MIN_PRICE'] == "Y") {
             $item['PRICE_CURRENCY'] = $price['CURRENCY'];
             $item['PRICE_DISCOUNT_VALUE'] = $price['DISCOUNT_VALUE'];
             $item['PRICE_PRINT_DISCOUNT_VALUE'] = $price['PRINT_DISCOUNT_VALUE'];
             $item['PRICE_VALUE'] = $price['VALUE'];
             $item['PRICE_PRINT_VALUE'] = $price['PRINT_VALUE'];
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: unset

 unset($comparePath, $currentPath);
 foreach ($arResult["ITEMS"] as &$arItem) {
     $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"] = htmlspecialcharsex($arColumn["NAME_LANG"]);
                 }
             }
         }
     } else {
         $arItem["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["IBLOCK_ID"], $arResult["PRICES"], $arItem, $arParams['PRICE_VAT_INCLUDE'], $arConvertParams);
         if (!empty($arItem["PRICES"])) {
             foreach ($arItem['PRICES'] as &$arOnePrice) {
                 if ('Y' == $arOnePrice['MIN_PRICE']) {
                     $arItem['MIN_PRICE'] = $arOnePrice;
                     break;
                 }
             }
             unset($arOnePrice);
         }
     }
     $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']);
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例3: GetOffersArray


//.........这里部分代码省略.........
					array('PRODUCT_ID' => $arOfferIDs),
					false,
					false,
					array('PRODUCT_ID', 'RATIO')
				);
				while ($arRatio = $rsRatios->Fetch())
				{
					$arRatio['PRODUCT_ID'] = intval($arRatio['PRODUCT_ID']);
					if (isset($arOffersLink[$arRatio['PRODUCT_ID']]))
					{
						$intRatio = intval($arRatio['RATIO']);
						$dblRatio = doubleval($arRatio['RATIO']);
						$mxRatio = ($dblRatio > $intRatio ? $dblRatio : $intRatio);
						if (CATALOG_VALUE_EPSILON > abs($mxRatio))
							$mxRatio = 1;
						elseif (0 > $mxRatio)
							$mxRatio = 1;
						$arOffersLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
					}
				}

				if (!empty($arSelectProperties))
				{
					CIBlockElement::GetPropertyValuesArray($arOffersLink, $intOfferIBlockID, $arFilter);
					foreach ($arResult as &$arOffer)
					{
						CCatalogDiscount::SetProductPropertiesCache($arOffer['ID'], $arOffer["PROPERTIES"]);
						foreach ($arSelectProperties as $pid)
						{
							if (!isset($arOffer["PROPERTIES"][$pid]))
								continue;
							$prop = &$arOffer["PROPERTIES"][$pid];
							$boolArr = is_array($prop["VALUE"]);
							if(
								($boolArr && !empty($prop["VALUE"])) ||
								(!$boolArr && strlen($prop["VALUE"])>0))
							{
								$arOffer["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arOffer, $prop, "catalog_out");
							}
						}
						if (isset($arOffer))
							unset($arOffer);
					}
				}

				CCatalogDiscount::SetProductSectionsCache($arOfferIDs);
				CCatalogDiscount::SetDiscountProductCache($arOfferIDs, array('IBLOCK_ID' => $intOfferIBlockID, 'GET_BY_ID' => 'Y'));
				foreach ($arResult as &$arOffer)
				{
					$arOffer['CATALOG_QUANTITY'] = (
						0 < $arOffer['CATALOG_QUANTITY'] && is_float($arOffer['CATALOG_MEASURE_RATIO'])
						? floatval($arOffer['CATALOG_QUANTITY'])
						: intval($arOffer['CATALOG_QUANTITY'])
					);
					$arOffer['MIN_PRICE'] = false;
					$arOffer["PRICES"] = CIBlockPriceTools::GetItemPrices($arOffersIBlock["OFFERS_IBLOCK_ID"], $arPrices, $arOffer, $vat_include, $arCurrencyParams, $USER_ID, $LID);
					if (!empty($arOffer["PRICES"]))
					{
						foreach ($arOffer['PRICES'] as &$arOnePrice)
						{
							if ('Y' == $arOnePrice['MIN_PRICE'])
							{
								$arOffer['MIN_PRICE'] = $arOnePrice;
								break;
							}
						}
						unset($arOnePrice);
					}
					$arOffer["CAN_BUY"] = CIBlockPriceTools::CanBuy($arOffersIBlock["OFFERS_IBLOCK_ID"], $arPrices, $arOffer);
				}
				if (isset($arOffer))
					unset($arOffer);
			}
			if (!empty($arMeasureMap))
			{
				$rsMeasures = CCatalogMeasure::getList(
					array(),
					array('@ID' => array_keys($arMeasureMap)),
					false,
					false,
					array('ID', 'SYMBOL_RUS')
				);
				while ($arMeasure = $rsMeasures->GetNext())
				{
					$arMeasure['ID'] = intval($arMeasure['ID']);
					if (isset($arMeasureMap[$arMeasure['ID']]) && !empty($arMeasureMap[$arMeasure['ID']]))
					{
						foreach ($arMeasureMap[$arMeasure['ID']] as &$intOneKey)
						{
							$arResult[$intOneKey]['CATALOG_MEASURE_NAME'] = $arMeasure['SYMBOL_RUS'];
							$arResult[$intOneKey]['~CATALOG_MEASURE_NAME'] = $arMeasure['~SYMBOL_RUS'];
						}
						unset($intOneKey);
					}
				}
			}
		}

		return $arResult;
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:101,代码来源:comp_pricetools.php

示例4: CatalogGetPriceTableEx

		$ID = $arElement["PROPERTY_".strtoupper($arParams["LINK_PROPERTY_SID"])."_VALUE"];
		if(!array_key_exists($ID, $arFound) || (strpos($arElement["XML_ID"], "#")===false))
		{
			$arFound[$ID] = true;
			$arItem = &$arResult["ITEMS"][$arMap[$ID]];

			if($arParams["USE_PRICE_COUNT"])
			{
				if(CModule::IncludeModule("catalog"))
				{
					$arItem["PRICE_MATRIX"] = CatalogGetPriceTableEx($arElement["ID"]);
					foreach($arItem["PRICE_MATRIX"]["COLS"] as $keyColumn=>$arColumn)
						$arItem["PRICE_MATRIX"]["COLS"][$keyColumn]["NAME_LANG"] = htmlspecialchars($arColumn["NAME_LANG"]);
				}
				else
				{
					$arItem["PRICE_MATRIX"] = false;
				}
				$arItem["PRICES"] = array();
			}
			else
			{
				$arItem["PRICE_MATRIX"] = false;
				$arItem["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["LINK_IBLOCK_ID"], $arResult["PRICES"], $arElement);
			}
			$arItem["CAN_BUY"] = CIBlockPriceTools::CanBuy($arParams["LINK_IBLOCK_ID"], $arResult["PRICES"], $arElement);
		}
	}
}
?>
开发者ID:ASDAFF,项目名称:Components-for-Bitrix,代码行数:30,代码来源:result_modifier.php

示例5: GetOffersArray

	public static function GetOffersArray($IBLOCK_ID, $arElementID, $arOrder, $arSelectFields, $arSelectProperties, $limit, $arPrices, $vat_include, $arCurrencyParams = array(), $USER_ID = 0, $LID = SITE_ID)
	{
		$arResult = array();

		$arOffersIBlock = CIBlockPriceTools::GetOffersIBlock($IBLOCK_ID);
		if($arOffersIBlock)
		{
			$limit = intval($limit);
			if (0 > $limit)
				$limit = 0;

			if(!array_key_exists("ID", $arOrder))
				$arOrder["ID"] = "DESC";

			$arFilter = array(
				"IBLOCK_ID" => $arOffersIBlock["OFFERS_IBLOCK_ID"],
				"PROPERTY_".$arOffersIBlock["OFFERS_PROPERTY_ID"] => $arElementID,
				"ACTIVE" => "Y",
				"ACTIVE_DATE" => "Y",
			);

			$arSelect = array(
				"ID" => 1,
				"IBLOCK_ID" => 1,
				"PROPERTY_".$arOffersIBlock["OFFERS_PROPERTY_ID"] => 1,
			);
			//if(!$arParams["USE_PRICE_COUNT"])
			{
				foreach($arPrices as $value)
				{
					$arSelect[$value["SELECT"]] = 1;
					//$arrFilter["CATALOG_SHOP_QUANTITY_".$value["ID"]] = $arParams["SHOW_PRICE_COUNT"];
				}
			}

			foreach($arSelectFields as $code)
				$arSelect[$code] = 1; //mark to select

			$arOffersPerElement = array();
			$rsOffers = CIBlockElement::GetList($arOrder, $arFilter, false, false, array_keys($arSelect));
			while($obOffer = $rsOffers->GetNextElement())
			{
				$arOffer = $obOffer->GetFields();
				$element_id = $arOffer["PROPERTY_".$arOffersIBlock["OFFERS_PROPERTY_ID"]."_VALUE"];
				//No more than limit offers per element
				if($limit > 0)
				{
					$arOffersPerElement[$element_id]++;
					if($arOffersPerElement[$element_id] > $limit)
						continue;
				}

				if($element_id > 0)
				{
					$arOffer["LINK_ELEMENT_ID"] = $element_id;
					$arOffer["DISPLAY_PROPERTIES"] = array();
					if(!empty($arSelectProperties))
					{
						$arOffer["PROPERTIES"] = $obOffer->GetProperties();
						foreach($arSelectProperties as $pid)
						{
							$prop = &$arOffer["PROPERTIES"][$pid];
							if((is_array($prop["VALUE"]) && count($prop["VALUE"])>0) ||
							(!is_array($prop["VALUE"]) && strlen($prop["VALUE"])>0))
							{
								$arOffer["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arOffer, $prop, "catalog_out");
							}
						}
					}

					$arOffer["PRICES"] = CIBlockPriceTools::GetItemPrices($arOffersIBlock["OFFERS_IBLOCK_ID"], $arPrices, $arOffer, $vat_include, $arCurrencyParams, $USER_ID, $LID);
					$arOffer["CAN_BUY"] = CIBlockPriceTools::CanBuy($arOffersIBlock["OFFERS_IBLOCK_ID"], $arPrices, $arOffer);
				}
				$arResult[] = $arOffer;
			}
		}

		return $arResult;
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:79,代码来源:comp_pricetools.php

示例6: array

                 $arFields = $obEl->GetFields();
                 if (!empty($arFields["IBLOCK_SECTION_ID"])) {
                     $arSec = $arSect;
                 }
                 $path = !empty($arFields['DETAIL_PICTURE']) ? $arFields['DETAIL_PICTURE'] : $arFields['PREVIEW_PICTURE'];
                 if (empty($path)) {
                     $arProp = CIBlockElement::GetProperty($arFields["IBLOCK_ID"], $arFields["ID"], array(), array('CODE' => 'MORE_PHOTO'))->Fetch();
                     $path = $arProp["VALUE"];
                 }
                 $path = CFile::ResizeImageGet($path, array('width' => 150, 'height' => 150), BX_RESIZE_IMAGE_PROPORTIONAL, false);
                 $path = $path['src'];
                 if (CModule::IncludeModule('catalog')) {
                     $arResultPrices = CIBlockPriceTools::GetCatalogPrices($arFields["IBLOCK_ID"], array($arParams["PRICE_CODE"]));
                     $arProduct = CCatalogProduct::GetByID($arFields["ID"]);
                     $arProduct['VAT_INCLUDED'] = $arProduct['VAT_INCLUDED'] == 'Y' ? true : false;
                     $arPrices = CIBlockPriceTools::GetItemPrices($arFields["IBLOCK_ID"], $arResultPrices, $arFields, $arProduct['VAT_INCLUDED'], array("CURRENCY_ID" => $arParams["CURRENCY"]));
                 }
                 $arHits[$index][] = array("NAME" => $arFields["NAME"], "SECTION" => $arSec["NAME"], "SECTION_PAGE_URL" => $arSec["SECTION_PAGE_URL"], "DETAIL_PAGE_URL" => $arFields["DETAIL_PAGE_URL"], "PHOTO" => $path, "PRICE" => $arPrices, "SALELEADER" => $arFields["PROPERTY_SALELEADER_VALUE"], "NEWPRODUCT" => $arFields["PROPERTY_NEWPRODUCT_VALUE"], "SPECIAL_OFFER" => $arFields["PROPERTY_SPECIAL_OFFER_VALUE"]);
             }
             // while( $obEl = $dbRes->GetNextElement() )
             $arResult['HITS'][$index] = $arHits[$index];
         }
         // if($arParams["VIEW_HIT"] == "Y" && $arItem['DEPTH_LEVEL'] == 1)
     }
     // foreach($arResult as &$arItem => $index)
     if ($obCache->StartDataCache($life_time, $cache_id, "/")) {
         $obCache->EndDataCache(array("MENU_HITS" => $arHits));
     }
 }
 // if(!is_array($arResult['HITS']))
 unset($obCache);
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:result_modifier.php

示例7: unset

            $arPriceTypeID[] = $value["ID"];
        }
        if (isset($value)) {
            unset($value);
        }
    }
    $arFound = array();
    $rsElements = CIBlockElement::GetList($arSort, $arFilter, false, false, $arSelect);
    while ($arElement = $rsElements->GetNext()) {
        $ID = $arElement["PROPERTY_" . strtoupper($arParams["LINK_PROPERTY_SID"]) . "_VALUE"];
        if (!array_key_exists($ID, $arFound) || strpos($arElement["XML_ID"], "#") === false) {
            $arFound[$ID] = true;
            $arItem =& $arResult["ITEMS"][$arMap[$ID]];
            if ($arParams["USE_PRICE_COUNT"]) {
                if (CModule::IncludeModule("catalog")) {
                    $arItem["PRICE_MATRIX"] = CatalogGetPriceTableEx($arElement["ID"], 0, $arPriceTypeID, 'Y', $arResult['CONVERT_CURRENCY']);
                    foreach ($arItem["PRICE_MATRIX"]["COLS"] as $keyColumn => $arColumn) {
                        $arItem["PRICE_MATRIX"]["COLS"][$keyColumn]["NAME_LANG"] = htmlspecialcharsbx($arColumn["NAME_LANG"]);
                    }
                } else {
                    $arItem["PRICE_MATRIX"] = false;
                }
                $arItem["PRICES"] = array();
            } else {
                $arItem["PRICE_MATRIX"] = false;
                $arItem["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["LINK_IBLOCK_ID"], $arResult["PRICES"], $arElement, $arParams['PRICE_VAT_INCLUDE'], $arResult['CONVERT_CURRENCY']);
            }
            $arItem["CAN_BUY"] = CIBlockPriceTools::CanBuy($arParams["LINK_IBLOCK_ID"], $arResult["PRICES"], $arElement);
        }
    }
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:result_modifier.php

示例8: setItemsPrices

 /**
  * set prices for all items
  * @return array currency list
  */
 protected function setItemsPrices()
 {
     global $APPLICATION;
     // Get Available prices
     $prices = $this->data['CATALOG_PRICES'];
     // Convert params
     $convertParams = array();
     if ('Y' == $this->arParams['CONVERT_CURRENCY']) {
         if (!$this->isCurrency) {
             $this->arParams['CONVERT_CURRENCY'] = 'N';
             $this->arParams['CURRENCY_ID'] = '';
         } else {
             $currencyInfo = $this->data['CURRENCY'][$this->arParams['CURRENCY_ID']];
             if (!empty($currencyInfo) && is_array($currencyInfo)) {
                 $this->arParams['CURRENCY_ID'] = $currencyInfo['CURRENCY'];
                 $convertParams['CURRENCY_ID'] = $currencyInfo['CURRENCY'];
             } else {
                 $this->arParams['CONVERT_CURRENCY'] = 'N';
                 $this->arParams['CURRENCY_ID'] = '';
             }
         }
     }
     $this->data['CONVERT_CURRENCY'] = $convertParams;
     //  Set items Prices
     foreach ($this->items as &$item) {
         $item["PRICES"] = array();
         $item['MIN_PRICE'] = false;
         $item["PRICES"] = CIBlockPriceTools::GetItemPrices($item['IBLOCK_ID'], $prices, $item, $this->arParams['PRICE_VAT_INCLUDE'], $convertParams);
         if (!empty($item["PRICES"])) {
             foreach ($item['PRICES'] as &$onePrice) {
                 if ('Y' == $onePrice['MIN_PRICE']) {
                     $item['MIN_PRICE'] = $onePrice;
                     break;
                 }
             }
             unset($onePrice);
         }
         $item["CAN_BUY"] = CIBlockPriceTools::CanBuy($item['IBLOCK_ID'], $prices, $item);
         // Action links
         $item["~BUY_URL"] = $APPLICATION->GetCurPageParam($this->arParams["ACTION_VARIABLE"] . "=BUY&" . $this->arParams["PRODUCT_ID_VARIABLE"] . "=" . $item["ID"], array($this->arParams["PRODUCT_ID_VARIABLE"], $this->arParams["ACTION_VARIABLE"]));
         $item["BUY_URL"] = htmlspecialcharsbx($item["~BUY_URL"]);
         $item["~ADD_URL"] = $APPLICATION->GetCurPageParam($this->arParams["ACTION_VARIABLE"] . "=ADD2BASKET&" . $this->arParams["PRODUCT_ID_VARIABLE"] . "=" . $item["ID"], array($this->arParams["PRODUCT_ID_VARIABLE"], $this->arParams["ACTION_VARIABLE"]));
         $item["ADD_URL"] = htmlspecialcharsbx($item["~ADD_URL"]);
         $item["~COMPARE_URL"] = $APPLICATION->GetCurPageParam("action=ADD_TO_COMPARE_LIST&id=" . $item["ID"], array("action", "id"));
         $item["COMPARE_URL"] = htmlspecialcharsbx($item["~COMPARE_URL"]);
         $item["~SUBSCRIBE_URL"] = $APPLICATION->GetCurPageParam($this->arParams["ACTION_VARIABLE"] . "=SUBSCRIBE_PRODUCT&" . $this->arParams["PRODUCT_ID_VARIABLE"] . "=" . $item["ID"], array($this->arParams["PRODUCT_ID_VARIABLE"], $this->arParams["ACTION_VARIABLE"]));
         $item["SUBSCRIBE_URL"] = htmlspecialcharsbx($item["~SUBSCRIBE_URL"]);
     }
 }
开发者ID:akniyev,项目名称:arteva.ru,代码行数:53,代码来源:class.php

示例9: setItemsPrices

 /**
  * 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);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:28,代码来源:class.php

示例10: GetOffersArray


//.........这里部分代码省略.........
                     }
                     $arMeasureMap[$arOffer['CATALOG_MEASURE']][] = $intKey;
                 }
                 $arOfferIDs[] = $arOffer['ID'];
                 $arResult[$intKey] = $arOffer;
                 if (!isset($arOffersLink[$arOffer['ID']])) {
                     $arOffersLink[$arOffer['ID']] =& $arResult[$intKey];
                 } else {
                     if (!isset($extPrices[$arOffer['ID']])) {
                         $extPrices[$arOffer['ID']] = array();
                     }
                     $extPrices[$arOffer['ID']][] =& $arResult[$intKey];
                 }
                 $intKey++;
             }
         }
         if (!empty($arOfferIDs)) {
             $rsRatios = CCatalogMeasureRatio::getList(array(), array('@PRODUCT_ID' => $arOfferIDs), false, false, array('PRODUCT_ID', 'RATIO'));
             while ($arRatio = $rsRatios->Fetch()) {
                 $arRatio['PRODUCT_ID'] = (int) $arRatio['PRODUCT_ID'];
                 if (isset($arOffersLink[$arRatio['PRODUCT_ID']])) {
                     $intRatio = (int) $arRatio['RATIO'];
                     $dblRatio = (double) $arRatio['RATIO'];
                     $mxRatio = $dblRatio > $intRatio ? $dblRatio : $intRatio;
                     if (CATALOG_VALUE_EPSILON > abs($mxRatio)) {
                         $mxRatio = 1;
                     } elseif (0 > $mxRatio) {
                         $mxRatio = 1;
                     }
                     $arOffersLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
                 }
             }
             if (!empty($arSelectProperties)) {
                 CIBlockElement::GetPropertyValuesArray($arOffersLink, $intOfferIBlockID, $arFilter);
                 foreach ($arResult as &$arOffer) {
                     if (self::$needDiscountCache) {
                         CCatalogDiscount::SetProductPropertiesCache($arOffer['ID'], $arOffer["PROPERTIES"]);
                     }
                     foreach ($arSelectProperties as $pid) {
                         if (!isset($arOffer["PROPERTIES"][$pid])) {
                             continue;
                         }
                         $prop =& $arOffer["PROPERTIES"][$pid];
                         $boolArr = is_array($prop["VALUE"]);
                         if ($boolArr && !empty($prop["VALUE"]) || !$boolArr && strlen($prop["VALUE"]) > 0) {
                             $arOffer["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arOffer, $prop, "catalog_out");
                         }
                         unset($prop);
                     }
                 }
                 unset($arOffer);
             }
             if (!empty($extPrices)) {
                 foreach ($extPrices as $origID => $prices) {
                     foreach ($prices as $oneRow) {
                         $oneRow['PROPERTIES'] = $arOffersLink[$origID]['PROPERTIES'];
                         $oneRow['DISPLAY_PROPERTIES'] = $arOffersLink[$origID]['DISPLAY_PROPERTIES'];
                         $oneRow['CATALOG_MEASURE_RATIO'] = $arOffersLink[$origID]['CATALOG_MEASURE_RATIO'];
                     }
                 }
             }
             if (self::$needDiscountCache) {
                 CCatalogDiscount::SetProductSectionsCache($arOfferIDs);
                 CCatalogDiscount::SetDiscountProductCache($arOfferIDs, array('IBLOCK_ID' => $intOfferIBlockID, 'GET_BY_ID' => 'Y'));
             }
             foreach ($arResult as &$arOffer) {
                 $arOffer['CATALOG_QUANTITY'] = 0 < $arOffer['CATALOG_QUANTITY'] && is_float($arOffer['CATALOG_MEASURE_RATIO']) ? (double) $arOffer['CATALOG_QUANTITY'] : (int) $arOffer['CATALOG_QUANTITY'];
                 $arOffer['MIN_PRICE'] = false;
                 $arOffer["PRICES"] = CIBlockPriceTools::GetItemPrices($arOffersIBlock["OFFERS_IBLOCK_ID"], $arPrices, $arOffer, $vat_include, $arCurrencyParams, $USER_ID, $LID);
                 if (!empty($arOffer["PRICES"])) {
                     foreach ($arOffer['PRICES'] as &$arOnePrice) {
                         if ($arOnePrice['MIN_PRICE'] == 'Y') {
                             $arOffer['MIN_PRICE'] = $arOnePrice;
                             break;
                         }
                     }
                     unset($arOnePrice);
                 }
                 $arOffer["CAN_BUY"] = CIBlockPriceTools::CanBuy($arOffersIBlock["OFFERS_IBLOCK_ID"], $arPrices, $arOffer);
             }
             if (isset($arOffer)) {
                 unset($arOffer);
             }
         }
         if (!empty($arMeasureMap)) {
             $rsMeasures = CCatalogMeasure::getList(array(), array('@ID' => array_keys($arMeasureMap)), false, false, array('ID', 'SYMBOL_RUS'));
             while ($arMeasure = $rsMeasures->GetNext()) {
                 $arMeasure['ID'] = (int) $arMeasure['ID'];
                 if (isset($arMeasureMap[$arMeasure['ID']]) && !empty($arMeasureMap[$arMeasure['ID']])) {
                     foreach ($arMeasureMap[$arMeasure['ID']] as &$intOneKey) {
                         $arResult[$intOneKey]['CATALOG_MEASURE_NAME'] = $arMeasure['SYMBOL_RUS'];
                         $arResult[$intOneKey]['~CATALOG_MEASURE_NAME'] = $arMeasure['~SYMBOL_RUS'];
                     }
                     unset($intOneKey);
                 }
             }
         }
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:comp_pricetools.php

示例11: foreach

                 $arParams['CURRENCY_ID'] = $arCurrencyInfo['CURRENCY'];
                 $arConvertParams['CURRENCY_ID'] = $arCurrencyInfo['CURRENCY'];
             }
         }
     }
     $bCatalog = CModule::IncludeModule('catalog');
     foreach ($arResult["SET_ITEMS"] as $key => $setItem) {
         if ($arParams["USE_PRICE_COUNT"]) {
             if ($bCatalog) {
                 $arResult["SET_ITEMS"][$key]["PRICE_MATRIX"] = CatalogGetPriceTableEx($arResult["SET_ITEMS"][$key]["ID"], 0, $arPriceTypeID, 'Y', $arConvertParams);
                 foreach ($arResult["SET_ITEMS"][$key]["PRICE_MATRIX"]["COLS"] as $keyColumn => $arColumn) {
                     $arResult["SET_ITEMS"][$key]["PRICE_MATRIX"]["COLS"][$keyColumn]["NAME_LANG"] = htmlspecialcharsbx($arColumn["NAME_LANG"]);
                 }
             }
         } else {
             $arResult["SET_ITEMS"][$key]["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["IBLOCK_ID"], $arResultPrices, $arResult["SET_ITEMS"][$key], $arParams['PRICE_VAT_INCLUDE'], $arConvertParams);
             if (!empty($arResult["SET_ITEMS"][$key]["PRICES"])) {
                 foreach ($arResult["SET_ITEMS"][$key]['PRICES'] as &$arOnePrice) {
                     if ('Y' == $arOnePrice['MIN_PRICE']) {
                         $arResult["SET_ITEMS"][$key]['MIN_PRICE'] = $arOnePrice;
                         break;
                     }
                 }
                 unset($arOnePrice);
             }
         }
         if ($arParams["SHOW_MEASURE"] == "Y" && $setItem["CATALOG_MEASURE"]) {
             $arResult["SET_ITEMS"][$key]["MEASURE"] = CCatalogMeasure::getList(array(), array("ID" => $setItem["CATALOG_MEASURE"]), false, false, array())->GetNext();
         }
     }
 }
开发者ID:Andreyjktl,项目名称:rezina74,代码行数:31,代码来源:result_modifier.php

示例12: bx_format_price

 public static function bx_format_price($price_codes, $arItem)
 {
     $arCatalogPrices = \CIBlockPriceTools::GetCatalogPrices($arItem['IBLOCK_ID'], $price_codes);
     return \CIBlockPriceTools::GetItemPrices($arItem['IBLOCK_ID'], $arCatalogPrices, $arItem);
 }
开发者ID:firestorm23,项目名称:bxhelper,代码行数:5,代码来源:BXHelper.php


注:本文中的CIBlockPriceTools::GetItemPrices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。