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


PHP CCatalogDiscount::GetDiscountTypes方法代碼示例

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


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

示例1: CheckFields


//.........這裏部分代碼省略.........
             $arFields['RENEWAL'] = $arFields['RENEWAL'] == 'Y' ? 'Y' : 'N';
         }
         if (isset($arFields['MAX_USES'])) {
             $arFields['MAX_USES'] = (int) $arFields['MAX_USES'];
             if ($arFields['MAX_USES'] < 0) {
                 $arFields['MAX_USES'] = 0;
             }
         }
         if (isset($arFields['COUNT_USES'])) {
             $arFields['COUNT_USES'] = (int) $arFields['COUNT_USES'];
             if ($arFields['COUNT_USES'] < 0) {
                 $arFields['COUNT_USES'] = 0;
             }
         }
         if (isset($arFields['CATALOG_COUPONS'])) {
             if (empty($arFields['CATALOG_COUPONS']) && !is_array($arFields['CATALOG_COUPONS'])) {
                 unset($arFields['CATALOG_COUPONS']);
             }
         }
         if (isset($arFields['SORT'])) {
             $arFields['SORT'] = (int) $arFields['SORT'];
             if ($arFields['SORT'] <= 0) {
                 $arFields['SORT'] = 100;
             }
         }
         if (isset($arFields['MAX_DISCOUNT'])) {
             $arFields['MAX_DISCOUNT'] = str_replace(',', '.', $arFields['MAX_DISCOUNT']);
             $arFields['MAX_DISCOUNT'] = doubleval($arFields['MAX_DISCOUNT']);
             if ($arFields['MAX_DISCOUNT'] < 0) {
                 $arFields['MAX_DISCOUNT'] = 0;
             }
         }
         if ($boolValueType) {
             if (!in_array($arFields['VALUE_TYPE'], CCatalogDiscount::GetDiscountTypes())) {
                 $arFields['VALUE_TYPE'] = self::TYPE_PERCENT;
             }
         }
         if ($boolValue) {
             $arFields['VALUE'] = str_replace(',', '.', $arFields['VALUE']);
             $arFields['VALUE'] = doubleval($arFields['VALUE']);
             if ($arFields['VALUE'] <= 0) {
                 $boolResult = false;
                 $arMsg[] = array('id' => 'VALUE', 'text' => Loc::getMessage('BT_MOD_CATALOG_DISC_ERR_BAD_VALUE'));
             }
         }
         if ($ACTION == 'UPDATE') {
             if ($boolValue != $boolValueType) {
                 if (!$boolValue) {
                     $arFields['VALUE'] = $arCurrent['VALUE'];
                     $boolValue = true;
                 }
                 if (!$boolValueType) {
                     $arFields['VALUE_TYPE'] = $arCurrent['VALUE_TYPE'];
                     $boolValueType = true;
                 }
             }
         }
         if ($boolValue && $boolValueType) {
             if ($arFields['VALUE_TYPE'] == self::TYPE_PERCENT && $arFields['VALUE'] > 100) {
                 $boolResult = false;
                 $arMsg[] = array('id' => 'VALUE', 'text' => Loc::getMessage("BT_MOD_CATALOG_DISC_ERR_BAD_VALUE"));
             }
         }
         if (isset($arFields['MIN_ORDER_SUM'])) {
             $arFields['MIN_ORDER_SUM'] = str_replace(',', '.', $arFields['MIN_ORDER_SUM']);
             $arFields['MIN_ORDER_SUM'] = doubleval($arFields['MIN_ORDER_SUM']);
開發者ID:rasuldev,項目名稱:torino,代碼行數:67,代碼來源:discount.php

示例2: array

			echo CAdminCalendar::CalendarPeriodCustom("ACTIVE_FROM", "ACTIVE_TO", $arDiscount['ACTIVE_FROM'], $arDiscount['ACTIVE_TO'], true, 19, true, array(
				CAdminCalendar::PERIOD_EMPTY => GetMessage('BT_CAT_DISCOUNT_EDIT_CALENDARE_PERIOD_EMPTY'),
				CAdminCalendar::PERIOD_INTERVAL => GetMessage('BT_CAT_DISCOUNT_EDIT_CALENDARE_PERIOD_INTERVAL')
			));
		?></td>
	</tr><?
	$tabControl->EndCustomField("PERIOD",
		'<input type="hidden" name="ACTIVE_FROM" value="'.htmlspecialcharsbx($arDiscount['ACTIVE_FROM']).'">'.
		'<input type="hidden" name="ACTIVE_TO" value="'.htmlspecialcharsbx($arDiscount['ACTIVE_FROM']).'">'
	);
	$tabControl->BeginCustomField("VALUE_TYPE", GetMessage('DSC_TYPE').":",true);
	?><tr id="tr_VALUE_TYPE" class="adm-detail-required-field">
		<td width="40%"><? echo $tabControl->GetCustomLabelHTML(); ?></td>
		<td width="60%">
			<select name="VALUE_TYPE" id="ob_value_type"><?
				foreach (CCatalogDiscount::GetDiscountTypes(true) as $key => $value)
				{
					?><option value="<? echo htmlspecialcharsbx($key); ?>"<?if ($arDiscount['VALUE_TYPE'] == $key) echo " selected";?>><? echo htmlspecialcharsex($value); ?></option><?
				}
			?></select>
		</td>
	</tr><?
	$tabControl->EndCustomField("VALUE_TYPE",
		'<input type="hidden" name="VALUE_TYPE" value="'.htmlspecialcharsbx($arDiscount['VALUE_TYPE']).'">'
	);
	$tabControl->AddEditField("VALUE", GetMessage("DSC_VALUE").":", true, array('size' => 20, 'maxlength' => 20), roundEx($arDiscount['VALUE'], CATALOG_VALUE_PRECISION));
	$tabControl->AddDropDownField("CURRENCY", GetMessage('DSC_CURRENCY').':', true, $arCurrencyList, $arDiscount['CURRENCY']);
	$tabControl->BeginCustomField("MAX_DISCOUNT", GetMessage('DSC_MAX_SUM').":",false);
	?><tr id="tr_MAX_DISCOUNT" style="display: <? echo 'P' == $arDiscount['VALUE_TYPE'] ? 'table-row' : 'none'; ?>;">
		<td width="40%"><? echo $tabControl->GetCustomLabelHTML(); ?></td>
		<td width="60%"><input id="ob_max_discount" type="text" name="MAX_DISCOUNT" size="20" maxlength="20" value="<?php 
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:31,代碼來源:cat_discount_edit.php


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