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


PHP CIBlockPriceTools::GetAllowCatalogPrices方法代码示例

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


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

示例1:

		{
			$arResultModules['catalog'] = true;
			$arResultModules['currency'] = true;
			$arCatalog = CCatalogSKU::GetInfoByIBlock($arParams["IBLOCK_ID"]);
			if (!empty($arCatalog) && is_array($arCatalog))
			{
				$bIBlockCatalog = $arCatalog['CATALOG_TYPE'] != CCatalogSKU::TYPE_PRODUCT;
				$boolNeedCatalogCache = true;
			}
		}
		$arResult['CATALOG'] = $arCatalog;

		//This function returns array with prices description and access rights
		//in case catalog module n/a prices get values from element properties
		$arResultPrices = CIBlockPriceTools::GetCatalogPrices($arParams["IBLOCK_ID"], $arParams["PRICE_CODE"]);
		$arResultPricesAllow = CIBlockPriceTools::GetAllowCatalogPrices($arResultPrices);

		if ($bCatalog && $boolNeedCatalogCache && !empty($arResultPricesAllow))
		{
			$boolNeedCatalogCache = CIBlockPriceTools::SetCatalogDiscountCache($arResultPricesAllow, $USER->GetUserGroupArray());
		}

		$WF_SHOW_HISTORY = "N";
		if ($arParams["SHOW_WORKFLOW"] && CModule::IncludeModule("workflow"))
		{
			$arResultModules['workflow'] = true;
			$WF_ELEMENT_ID = CIBlockElement::WF_GetLast($arParams["ELEMENT_ID"]);

			$WF_STATUS_ID = CIBlockElement::WF_GetCurrentStatus($WF_ELEMENT_ID, $WF_STATUS_TITLE);
			$WF_STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($WF_STATUS_ID);
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:30,代码来源:component.php

示例2: array

 $bCatalog = Loader::includeModule('catalog');
 if ($bCatalog) {
     $arResultModules['catalog'] = true;
     $arResultModules['currency'] = true;
     $arCatalog = CCatalogSKU::GetInfoByIBlock($arParams["IBLOCK_ID"]);
     if (!empty($arCatalog) && is_array($arCatalog)) {
         $bIBlockCatalog = $arCatalog['CATALOG_TYPE'] != CCatalogSKU::TYPE_PRODUCT;
         $bOffersIBlockExist = $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_PRODUCT || $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_FULL;
         $boolNeedCatalogCache = true;
     }
 }
 $arResult['CATALOG'] = $arCatalog;
 //This function returns array with prices description and access rights
 //in case catalog module n/a prices get values from element properties
 $arResult["PRICES"] = CIBlockPriceTools::GetCatalogPrices($arParams["IBLOCK_ID"], $arParams["PRICE_CODE"]);
 $arResult['PRICES_ALLOW'] = CIBlockPriceTools::GetAllowCatalogPrices($arResult["PRICES"]);
 if ($bCatalog && $boolNeedCatalogCache && !empty($arResult['PRICES_ALLOW'])) {
     $boolNeedCatalogCache = CIBlockPriceTools::SetCatalogDiscountCache($arResult['PRICES_ALLOW'], $USER->GetUserGroupArray());
 }
 $arResult['CONVERT_CURRENCY'] = $arConvertParams;
 if ($arResult["ID"] > 0) {
     $ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues($arResult["IBLOCK_ID"], $arResult["ID"]);
     $arResult["IPROPERTY_VALUES"] = $ipropValues->getValues();
 } else {
     $arResult["IPROPERTY_VALUES"] = array();
 }
 $arResult["PICTURE"] = CFile::GetFileArray($arResult["PICTURE"]);
 if ($arResult["PICTURE"]) {
     if ($arResult["ID"] > 0) {
         $arResult["PICTURE"]["ALT"] = $arResult["IPROPERTY_VALUES"]["SECTION_PICTURE_FILE_ALT"];
     }
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例3: GetOffersArray

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

		$arResult = array();

		$boolCheckPermissions = false;
		$boolHideNotAvailable = false;
		$showPriceCount = false;
		$IBLOCK_ID = 0;
		if (!empty($arFilter) && is_array($arFilter))
		{
			if (isset($arFilter['IBLOCK_ID']))
				$IBLOCK_ID = $arFilter['IBLOCK_ID'];
			if (isset($arFilter['HIDE_NOT_AVAILABLE']))
				$boolHideNotAvailable = ($arFilter['HIDE_NOT_AVAILABLE'] === 'Y');
			if (isset($arFilter['CHECK_PERMISSIONS']))
				$boolCheckPermissions = ($arFilter['CHECK_PERMISSIONS'] === 'Y');
			if (isset($arFilter['SHOW_PRICE_COUNT']))
			{
				$showPriceCount = (int)$arFilter['SHOW_PRICE_COUNT'];
				if ($showPriceCount <= 0)
					$showPriceCount = false;
			}
		}
		else
		{
			$IBLOCK_ID = $arFilter;
		}

		if (self::$needDiscountCache === null)
		{
			$pricesAllow = CIBlockPriceTools::GetAllowCatalogPrices($arPrices);
			if (empty($pricesAllow))
			{
				self::$needDiscountCache = false;
			}
			else
			{
				$USER_ID = (int)$USER_ID;
				$userGroups = ($USER_ID > 0 ? CUser::GetUserGroup($USER_ID) : $USER->GetUserGroupArray());
				$tmp = CIBlockPriceTools::SetCatalogDiscountCache($pricesAllow, $userGroups);
				unset($tmp, $userGroups);
			}
			unset($pricesAllow);
		}

		$arOffersIBlock = CIBlockPriceTools::GetOffersIBlock($IBLOCK_ID);
		if($arOffersIBlock)
		{
			$arDefaultMeasure = CCatalogMeasure::getDefaultMeasure(true, true);

			$limit = (int)$limit;
			if (0 > $limit)
				$limit = 0;

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

			$intOfferIBlockID = $arOffersIBlock["OFFERS_IBLOCK_ID"];

			$arFilter = array(
				"IBLOCK_ID" => $intOfferIBlockID,
				"PROPERTY_".$arOffersIBlock["OFFERS_PROPERTY_ID"] => $arElementID,
				"ACTIVE" => "Y",
				"ACTIVE_DATE" => "Y",
			);
			if ($boolHideNotAvailable)
				$arFilter['CATALOG_AVAILABLE'] = 'Y';
			if ($boolCheckPermissions)
			{
				$arFilter['CHECK_PERMISSIONS'] = "Y";
				$arFilter['MIN_PERMISSION'] = "R";
			}

			$arSelect = array(
				"ID" => 1,
				"IBLOCK_ID" => 1,
				"PROPERTY_".$arOffersIBlock["OFFERS_PROPERTY_ID"] => 1,
				"CATALOG_QUANTITY" => 1
			);
			//if(!$arParams["USE_PRICE_COUNT"])
			{
				foreach($arPrices as $value)
				{
					if (!$value['CAN_VIEW'] && !$value['CAN_BUY'])
						continue;
					$arSelect[$value["SELECT"]] = 1;
					if ($showPriceCount !== false)
					{
						$arFilter['CATALOG_SHOP_QUANTITY_'.$value['ID']] = $showPriceCount;
					}
				}
			}

			foreach($arSelectFields as $code)
				$arSelect[$code] = 1; //mark to select
			if (!isset($arSelect['PREVIEW_PICTURE']))
				$arSelect['PREVIEW_PICTURE'] = 1;
			if (!isset($arSelect['DETAIL_PICTURE']))
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:101,代码来源:comp_pricetools.php


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