本文整理汇总了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']);
示例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