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


PHP CIBlockPriceTools::CanBuy方法代码示例

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


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

示例1:

			{
				if ($arPrice['MIN_PRICE'] == "Y")
				{
					$arItem["PRICE_CURRENCY"] = $arPrice["CURRENCY"];
					$arItem["PRICE_DISCOUNT_VALUE"] = $arPrice["DISCOUNT_VALUE"];
					$arItem["PRICE_PRINT_DISCOUNT_VALUE"] = $arPrice["PRINT_DISCOUNT_VALUE"];
					$arItem["PRICE_VALUE"] = $arPrice["VALUE"];
					$arItem["PRICE_PRINT_VALUE"] = $arPrice["PRINT_VALUE"];
					$arItem["PRICE_DISCOUNT_DIFFERENCE_VALUE"] = $arPrice["DISCOUNT_DIFF"];
					$arItem["PRICE_DISCOUNT_DIFFERENCE"] = $arPrice["PRINT_DISCOUNT_DIFF"];
					$arItem["PRICE_DISCOUNT_PERCENT"] = $arPrice["DISCOUNT_DIFF_PERCENT"];
					break;
				}
			}

			$arItem["CAN_BUY"] = CIBlockPriceTools::CanBuy($arItem["IBLOCK_ID"], $arResult["PRICES"], $arItem);
		}

		if (defined("BX_COMP_MANAGED_CACHE"))
		{
			$CACHE_MANAGER->RegisterTag("iblock_id_".$arItem['IBLOCK_ID']);
		}

		if ($arItem["ID"] == $elementID)
		{
			$arResult["ELEMENT"] = $arItem;

			$arResult["SET_ITEMS"]["PRICE"] += $arItem["PRICE_DISCOUNT_VALUE"];
			$arResult["SET_ITEMS"]["OLD_PRICE"] += $arItem["PRICE_VALUE"];
			$arResult["SET_ITEMS"]["PRICE_DISCOUNT_DIFFERENCE"] += $arItem["PRICE_DISCOUNT_DIFFERENCE_VALUE"];
		}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:component.php

示例2: foreach

         	else
         	{
         		if (!empty($arItem["PRICES"]))
         		{
         			foreach ($arItem["PRICES"] as &$arOnePrices)
         			{
         				if (isset($arOnePrices['ORIG_CURRENCY']))
         					$arCurrencyList[] = $arOnePrices['ORIG_CURRENCY'];
         			}
         			if (isset($arOnePrices))
         				unset($arOnePrices);
         		}
         	}
         }
         */
         $arItem["CAN_BUY"] = CIBlockPriceTools::CanBuy($arParams["LINK_IBLOCK_ID"], $arResult["PRICES"], $arElement);
     }
 }
 if ('Y' == $arParams['CONVERT_CURRENCY']) {
     if (!empty($arCurrencyList)) {
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $arCurrencyList[] = $arConvertParams['CURRENCY_ID'];
             $arCurrencyList = array_unique($arCurrencyList);
             $CACHE_MANAGER->StartTagCache($this->__component->GetCachePath());
             foreach ($arCurrencyList as &$strOneCurrency) {
                 $CACHE_MANAGER->RegisterTag("currency_id_" . $strOneCurrency);
             }
             if (isset($strOneCurrency)) {
                 unset($strOneCurrency);
             }
             $CACHE_MANAGER->EndTagCache();
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:result_modifier.php

示例3: unset

         }
         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'];
             $item['PRICE_DISCOUNT_DIFFERENCE_VALUE'] = $price['DISCOUNT_DIFF'];
             $item['PRICE_DISCOUNT_DIFFERENCE'] = $price['PRINT_DISCOUNT_DIFF'];
             $item['PRICE_DISCOUNT_PERCENT'] = $price['DISCOUNT_DIFF_PERCENT'];
             break;
         }
     }
     unset($price, $priceList);
     //TODO: end
     $item['CAN_BUY'] = CIBlockPriceTools::CanBuy($item['IBLOCK_ID'], $arResult['PRICES'], $item);
     if (!empty($productLink[$item['ID']])) {
         foreach ($productLink[$item['ID']] as &$index) {
             $currentSet['ITEMS'][$index]['ITEM_DATA'] = $item;
         }
         unset($index);
     } elseif ($item['ID'] == $arResult['ELEMENT_ID']) {
         $currentSet['ITEM_DATA'] = $item;
     }
 }
 unset($select, $item, $itemsIterator);
 if (!$found || empty($currentSet['ITEM_DATA'])) {
     $this->AbortResultCache();
     return;
 }
 $defaultMeasure = CCatalogMeasure::getDefaultMeasure(true, true);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例4:

				$arResult["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["IBLOCK_ID"], $arResult["CAT_PRICES"], $arResult, $arParams['PRICE_VAT_INCLUDE'], $arConvertParams);
				if (!empty($arResult["PRICES"]))
				{
					foreach ($arResult['PRICES'] as &$arOnePrice)
					{
						if ('Y' == $arOnePrice['MIN_PRICE'])
						{
							$arResult['MIN_PRICE'] = $arOnePrice;
							break;
						}
					}
					unset($arOnePrice);
				}
			}

			$arResult["CAN_BUY"] = CIBlockPriceTools::CanBuy($arParams["IBLOCK_ID"], $arResult["CAT_PRICES"], $arResult);

			$arResult['~BUY_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['~BUY_URL_TEMPLATE']);
			$arResult['BUY_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['BUY_URL_TEMPLATE']);
			$arResult['~ADD_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['~ADD_URL_TEMPLATE']);
			$arResult['ADD_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['ADD_URL_TEMPLATE']);
			$arResult['LINK_URL'] = str_replace(
						array("#ELEMENT_ID#","#SECTION_ID#"),
						array($arResult["ID"],$arResult["SECTION"]["ID"]),
						$arParams["LINK_ELEMENTS_URL"]
					);
			$arResult['~SUBSCRIBE_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['~SUBSCRIBE_URL_TEMPLATE']);
			$arResult['SUBSCRIBE_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['SUBSCRIBE_URL_TEMPLATE']);
			if ($arParams['DISPLAY_COMPARE'])
			{
				$arResult['~COMPARE_URL'] = str_replace('#ID#', $arResult["ID"], $arResult['~COMPARE_URL_TEMPLATE']);
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:31,代码来源:component.php

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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


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