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


PHP CCatalogDiscount::GetDiscountGroupsList方法代码示例

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


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

示例1: array

}
$arDefaultValues = array('XML_ID' => '', 'SITE_ID' => '', 'NAME' => '', 'ACTIVE' => 'Y', 'SORT' => 100, 'ACTIVE_FROM' => '', 'ACTIVE_TO' => '', 'RENEWAL' => 'N', 'VALUE_TYPE' => 'P', 'VALUE' => '', 'MAX_DISCOUNT' => '', 'CURRENCY' => '', 'PRIORITY' => 1, 'LAST_DISCOUNT' => 'Y', 'NOTES' => '', 'CONDITIONS' => '');
$arDefCoupons = array('COUPON_ADD' => 'N', 'COUPON_TYPE' => Catalog\DiscountCouponTable::TYPE_ONE_ROW, 'COUPON_COUNT' => '');
$arSelect = array_merge(array('ID', 'VERSION'), array_keys($arDefaultValues));
$arDiscount = $arDefaultValues;
$arDiscountGroupList = array();
$arDiscountCatList = array();
$arCoupons = $arDefCoupons;
if (0 < $ID) {
    $rsDiscounts = CCatalogDiscount::GetList(array(), array("ID" => $ID), false, false, $arSelect);
    if (!($arDiscount = $rsDiscounts->Fetch())) {
        $ID = 0;
        $arDiscount = $arDefaultValues;
        $arCoupons = $arDefCoupons;
    } else {
        $rsDiscountGroups = CCatalogDiscount::GetDiscountGroupsList(array(), array('DISCOUNT_ID' => $ID, '>USER_GROUP_ID' => 0), false, false, array('ID', 'DISCOUNT_ID', 'USER_GROUP_ID'));
        while ($arDiscountGroup = $rsDiscountGroups->Fetch()) {
            $arDiscountGroupList[] = (int) $arDiscountGroup['USER_GROUP_ID'];
        }
        $rsDiscountCats = CCatalogDiscount::GetDiscountCatsList(array(), array('DISCOUNT_ID' => $ID, '>PRICE_TYPE_ID' => 0), false, false, array('ID', 'DISCOUNT_ID', 'PRICE_TYPE_ID'));
        while ($arDiscountCat = $rsDiscountCats->Fetch()) {
            $arDiscountCatList[] = (int) $arDiscountCat['PRICE_TYPE_ID'];
        }
        if (!isset($arDiscount['VERSION']) || (int) $arDiscount['VERSION'] != CCatalogDiscount::CURRENT_FORMAT) {
            $readOnly = true;
            $boolShowCoupons = false;
            $rsAdminNotify = CAdminNotify::GetList(array(), array('MODULE_ID' => 'catalog', 'TAG' => 'CATALOG_DISC_CONVERT'));
            if (!($arAdminNotify = $rsAdminNotify->Fetch())) {
                $strLangPath = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/catalog/lang/';
                $strDefLang = false;
                $arLangList = array();
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:cat_discount_edit.php

示例2: array

$arDiscountGroupList = array();
$arDiscountCatList = array();
$arCoupons = $arDefCoupons;

if (0 < $ID)
{
	$rsDiscounts = CCatalogDiscount::GetList(array(), array("ID" => $ID), false, false, $arSelect);
	if (!($arDiscount = $rsDiscounts->Fetch()))
	{
		$ID = 0;
		$arDiscount = $arDefaultValues;
		$arCoupons = $arDefCoupons;
	}
	else
	{
		$rsDiscountGroups = CCatalogDiscount::GetDiscountGroupsList(array(), array("DISCOUNT_ID" => $ID));
		while ($arDiscountGroup = $rsDiscountGroups->Fetch())
		{
			$arDiscountGroupList[] = intval($arDiscountGroup["GROUP_ID"]);
		}
		$rsDiscountCats = CCatalogDiscount::GetDiscountCatsList(array(), array("DISCOUNT_ID" => $ID));
		while ($arDiscountCat = $rsDiscountCats->Fetch())
		{
			$arDiscountCatList[] = intval($arDiscountCat["CATALOG_GROUP_ID"]);
		}

		if (!isset($arDiscount['VERSION']) || intval($arDiscount['VERSION']) != CCatalogDiscount::CURRENT_FORMAT)
		{
			$bReadOnly = true;
			$boolShowCoupons = false;
			$rsAdminNotify = CAdminNotify::GetList(array(), array('MODULE_ID'=>'catalog', 'TAG' => 'CATALOG_DISC_CONVERT'));
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:cat_discount_edit.php

示例3: GetUserDiscount

	/**
	 * Получение текущей скидки пользователя
	 * 
	 * @param int $USER_ID - идентификатор пользователя
	 */
	public static function GetUserDiscount($USER_ID)
	{
		global $USER;
		
		$arGroups = $USER -> GetUserGroup($USER_ID);
		$arDiscount = self::GetDiscountList();
		
		$iDiscount = 0;
		$GROUP_ID = "";
		
		foreach($arDiscount as $arItem)
		{
			if(in_array($arItem["PROPERTY_GROUP_ID_VALUE"], $arGroups))
				$GROUP_ID = $arItem["PROPERTY_GROUP_ID_VALUE"];
		}
		
		if($GROUP_ID && CModule::IncludeModule("catalog"))
		{
			$rs = CCatalogDiscount::GetDiscountGroupsList(array(), array("GROUP_ID" => $GROUP_ID));
			
			if($rs -> SelectedRowsCount())
			{
				$ar = $rs -> Fetch();
				
				$ar = CCatalogDiscount::GetByID($ar["DISCOUNT_ID"]);
				if($ar["VALUE_TYPE"] == "P")
					$iDiscount = intval($ar["VALUE"]);
			}
		}
		
		return $iDiscount;
	}
开发者ID:ASDAFF,项目名称:alba,代码行数:37,代码来源:cumulative_discount.php


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