當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCatalogDiscount::GetDiscountProductsList方法代碼示例

本文整理匯總了PHP中CCatalogDiscount::GetDiscountProductsList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCatalogDiscount::GetDiscountProductsList方法的具體用法?PHP CCatalogDiscount::GetDiscountProductsList怎麽用?PHP CCatalogDiscount::GetDiscountProductsList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCatalogDiscount的用法示例。


在下文中一共展示了CCatalogDiscount::GetDiscountProductsList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

// PR($_COOKIE["actionpay"]);

// file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/z/___log.php", "asd");

// PR($_COOKIE["bigbuzzy"]);


// Выборка товаров со скидками
$arFilter = array(
	"DISCOUNT_ID" => array(10, 11, 12, 13, 16, 18, 25, 27, 28, 29, 30, 33, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55)
	// "DISCOUNT_ID" => array(10, 11, 12, 13, 16, 18, 25, 27, 28, 29, 30, 33)
);
$res = CCatalogDiscount::GetDiscountProductsList(
	array(),
	$arFilter,
	false,
	false,
	array()
);
$str = "<?php \narray(\n";
while($item = $res->GetNext()){
	PR($item);
	$str .= "'" . $item["PRODUCT_ID"] . "',\n";
}
$str .= ");";
file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/include/discount_ids2.php", $str);


$arLogic = array(
		"CLASS_ID" => "CondGroup",
		"DATA" => array(
開發者ID:akniyev,項目名稱:arteva.ru,代碼行數:31,代碼來源:test.php

示例2: ConvertDiscount


//.........這裏部分代碼省略.........
         $boolEmpty = true;
         $arSrcList = array();
         $rsSections = CCatalogDiscount::GetDiscountSectionsList(array(), array('DISCOUNT_ID' => $arDiscount['ID']), false, false, array('SECTION_ID'));
         while ($arSection = $rsSections->Fetch()) {
             $boolEmpty = false;
             $arSrcList[] = $arSection['SECTION_ID'];
             $arSection['SECTION_ID'] = intval($arSection['SECTION_ID']);
             if (0 < $arSection['SECTION_ID']) {
                 $arSectionList[] = $arSection['SECTION_ID'];
             }
         }
         if (!empty($arSectionList)) {
             $arSectionList = array_values(array_unique($arSectionList));
             $rsSections = CIBlockSection::GetList(array(), array('ID' => $arSectionList), false, array('ID'));
             $arCheckResult = array();
             while ($arSection = $rsSections->Fetch()) {
                 $arCheckResult[] = intval($arSection['ID']);
             }
             if (!empty($arCheckResult)) {
                 $arSectionList = $arCheckResult;
                 $intEntityCount++;
             } else {
                 $arSectionList = array();
             }
         }
         if (empty($arSectionList)) {
             if (!$boolEmpty) {
                 $boolActive = false;
                 $arSrcEntity[] = str_replace('#IDS#', implode(', ', $arSrcList), GetMessage('BT_MOD_CAT_DSC_CONV_ENTITY_SECTION_ERR'));
             }
         }
         $boolEmpty = true;
         $arSrcList = array();
         $rsElements = CCatalogDiscount::GetDiscountProductsList(array(), array('DISCOUNT_ID' => $arDiscount['ID']), false, false, array('PRODUCT_ID'));
         while ($arElement = $rsElements->Fetch()) {
             $boolEmpty = false;
             $arSrcList[] = $arElement['PRODUCT_ID'];
             $arElement['PRODUCT_ID'] = intval($arElement['PRODUCT_ID']);
             if (0 < $arElement['PRODUCT_ID']) {
                 $arElementList[] = $arElement['PRODUCT_ID'];
             }
         }
         if (!empty($arElementList)) {
             $arElementList = array_values(array_unique($arElementList));
             $rsItems = CIBlockElement::GetList(array(), array('ID' => $arElementList), false, false, array('ID'));
             $arCheckResult = array();
             while ($arItem = $rsItems->Fetch()) {
                 $arCheckResult[] = intval($arItem['ID']);
             }
             if (!empty($arCheckResult)) {
                 $arElementList = $arCheckResult;
                 $intEntityCount++;
             } else {
                 $arElementList = array();
             }
         }
         if (empty($arElementList)) {
             if (!$boolEmpty) {
                 $boolActive = false;
                 $arSrcEntity[] = str_replace('#IDS#', implode(', ', $arSrcList), GetMessage('BT_MOD_CAT_DSC_CONV_ENTITY_ELEMENT_ERR'));
             }
         }
         if (!empty($arIBlockList)) {
             if (1 < count($arIBlockList)) {
                 $arList = array();
                 foreach ($arIBlockList as &$intItemID) {
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:67,代碼來源:discount_convert.php


注:本文中的CCatalogDiscount::GetDiscountProductsList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。