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


PHP CCatalogDiscount::Add方法代码示例

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


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

示例1: elseif

         if ($arSect = $dbSect->Fetch()) {
             $sofasSectId = $arSect["ID"];
         }
     }
     $dbSite = CSite::GetByID(WIZARD_SITE_ID);
     if ($arSite = $dbSite->Fetch()) {
         $lang = $arSite["LANGUAGE_ID"];
     }
     $defCurrency = "EUR";
     if ($lang == "ru") {
         $defCurrency = "RUB";
     } elseif ($lang == "en") {
         $defCurrency = "USD";
     }
     $arF = array("SITE_ID" => WIZARD_SITE_ID, "ACTIVE" => "Y", "RENEWAL" => "N", "NAME" => GetMessage("WIZ_DISCOUNT"), "SORT" => 100, "MAX_DISCOUNT" => 0, "VALUE_TYPE" => "P", "VALUE" => 10, "CURRENCY" => $defCurrency, "CONDITIONS" => array("CLASS_ID" => "CondGroup", "DATA" => array("All" => "OR", "True" => "True"), "CHILDREN" => array(array("CLASS_ID" => "CondIBSection", "DATA" => array("logic" => "Equal", "value" => $sofasSectId)))));
     CCatalogDiscount::Add($arF);
 }
 //precet
 $dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $IBLOCK_CATALOG_ID, "CODE" => "SALELEADER"));
 $arFields = array();
 while ($arProperty = $dbProperty->GetNext()) {
     $arFields["find_el_property_" . $arProperty["ID"]] = "";
 }
 $dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $IBLOCK_CATALOG_ID, "CODE" => "NEWPRODUCT"));
 while ($arProperty = $dbProperty->GetNext()) {
     $arFields["find_el_property_" . $arProperty["ID"]] = "";
 }
 $dbProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $IBLOCK_CATALOG_ID, "CODE" => "SPECIALOFFER"));
 while ($arProperty = $dbProperty->GetNext()) {
     $arFields["find_el_property_" . $arProperty["ID"]] = "";
 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:catalog3.php

示例2: GetMessage

				$errorMessage .= GetMessage('BT_CAT_DISCOUNT_EDIT_COUPON_COUNT')."<br>";
			}
		}
	}

	if (!$bVarsFromForm)
	{
		$DB->StartTransaction();

		if ($ID > 0 && !$boolCopy)
		{
			$res = CCatalogDiscount::Update($ID, $arFields);
		}
		else
		{
			$ID = CCatalogDiscount::Add($arFields);
			$res = ($ID > 0);
		}

		if (!$res)
		{
			if ($ex = $APPLICATION->GetException())
				$errorMessage .= $ex->GetString()."<br>";
			else
				$errorMessage .= (0 < $ID ? str_replace('#ID#', $ID, GetMessage('BT_CAT_DISCOUNT_EDIT_ERR_UPDATE')) : GetMessage('BT_CAT_DISCOUNT_EDIT_ERR_ADD'))."<br>";
			$bVarsFromForm = true;
			$DB->Rollback();
		}
		else
		{
			$DB->Commit();
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:cat_discount_edit.php

示例3: __OnElementDiscount

function __OnElementDiscount($arFields)
{
	$ProductPrc = false;
	$PropID = false;

	$res = CIBlockElement::GetProperty($arFields['IBLOCK_ID'],$arFields['ID'], "sort", "asc", array("CODE" => "DISCOUNT", 'EMPTY' => 'N'));
	if ($ob = $res->GetNext())
	{
		$PropID = $ob['ID'];
		$ProductPrc = $ob['VALUE'];
	}

	if($ProductPrc)
	{
		CModule::IncludeModule('catalog');
		$dbProductDiscounts = CCatalogDiscount::GetList(
			array(),
			array(
				"ACTIVE" => "Y",
				"VALUE" => $ProductPrc,
				"XML_ID" => 'IB_PROPERTY_'.$ProductPrc,
			),
			false,
			false,
			array(
				"ID", "VALUE"
			)
		);
		if (!$dbProductDiscounts->Fetch())
		{
			$arDiscountFields = Array(
			    'SITE_ID' => 's1',
			    'ACTIVE' => 'Y',
			    'RENEWAL' => 'N',
			    'XML_ID' => 'IB_PROPERTY_'.$ProductPrc,
			    'NAME' => 'Скидка по свойству - '.$ProductPrc.'%',
			    'SORT' => 100,
			    'VALUE_TYPE' => 'P',
			    'VALUE' => $ProductPrc,
			    'CURRENCY' => 'RUB',
			    'PRIORITY' => 1,
			    'LAST_DISCOUNT' => 'N',
			    'GROUP_IDS' => Array(),
			    'CATALOG_GROUP_IDS' => Array(),			
			    'CONDITIONS' => Array(
			            'CLASS_ID' => 'CondGroup',
			            'DATA' => Array(
			                    'All' => 'AND',
			                    'True' => 'True'
						),
			            'CHILDREN' => Array(
							Array(
	                            'CLASS_ID' => 'CondIBIBlock',
	                            'DATA' => Array(
	                                    'logic' => 'Equal',
	                                    'value' => $arFields['IBLOCK_ID']
										)
							),
							Array(
	                            'CLASS_ID' => 'CondIBProp:'.$arFields['IBLOCK_ID'].':'.$PropID,
	                            'DATA' => Array(
	                                    'logic' => 'Equal',
	                                    'value' => $ProductPrc
										)
							)
						)
					)
				);
			$ID = CCatalogDiscount::Add($arDiscountFields);
		}
	}
}
开发者ID:screate,项目名称:discount,代码行数:72,代码来源:discounts.php

示例4: array

		
		// PR($item);
		$dbProductDiscounts = CCatalogDiscount::GetList(array(), array("NOTES" => $item["discount_id"]), false, false, array())->Fetch();
		if(empty($dbProductDiscounts))
		{
			$arFields = array(
				"SITE_ID" => "s1",
				"NAME" => "Скидка из 1с " . $item["discount_name"],
				"CURRENCY" => "RUB",
				"PRIORITY" => 100,
				"VALUE_TYPE" => $item["discount_type"],
				"VALUE" => $item["discount_value"],
				"NOTES" => $item["discount_id"],
				"CONDITIONS" => serialize($arLogic),
			);
			$Ids[] = CCatalogDiscount::Add($arFields);
		}
		else
		{
			$arFields2 = array(
				"NAME" => "Скидка из 1с " . $item["discount_name"],
				"VALUE_TYPE" => $item["discount_type"],
				"VALUE" => $item["discount_value"],
				"NOTES" => $item["discount_id"],
				"CONDITIONS" => serialize($arLogic),
			);
			CCatalogDiscount::Update($dbProductDiscounts["ID"], $arFields2);
		}
	}
	PR($Ids);
}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:30,代码来源:DisHandler.php


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