本文整理汇总了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(
示例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) {