本文整理汇总了PHP中CCatalogDiscountSave::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogDiscountSave::Add方法的具体用法?PHP CCatalogDiscountSave::Add怎么用?PHP CCatalogDiscountSave::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogDiscountSave
的用法示例。
在下文中一共展示了CCatalogDiscountSave::Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usort
if (!empty($arFormRanges)) {
usort($arFormRanges, "__cmpRange");
}
}
if (empty($arFormRanges)) {
$arErrors[] = array('id' => 'RANGES', "text" => GetMessage('BT_CAT_DISC_SAVE_EDIT_ERR_RANGES_EMPTY'));
$bVarsFromForm = true;
}
if (!$bVarsFromForm) {
$arFields = array("XML_ID" => $_POST['XML_ID'], "SITE_ID" => $_POST['SITE_ID'], "NAME" => $_POST['NAME'], "ACTIVE" => $_POST['ACTIVE'] != "Y" ? "N" : "Y", "SORT" => intval($_POST['SORT']), "CURRENCY" => $_POST['CURRENCY'], "ACTIVE_FROM" => $_POST['ACTIVE_FROM'], "ACTIVE_TO" => $_POST['ACTIVE_TO'], "COUNT_SIZE" => $_POST['COUNT_SIZE'], "COUNT_TYPE" => $_POST['COUNT_TYPE'], "ACTION_SIZE" => $_POST['ACTION_SIZE'], "ACTION_TYPE" => $_POST['ACTION_TYPE'], "COUNT_FROM" => $_POST['COUNT_FROM'], "COUNT_TO" => $_POST['COUNT_TO'], "GROUP_IDS" => $_POST['GROUP_IDS'], "RANGES" => $arFormRanges);
}
if (!$bVarsFromForm) {
if ($ID > 0 && !$boolCopy) {
$mxRes = $obDiscSave->Update($ID, $arFields);
} else {
$ID = $obDiscSave->Add($arFields);
$mxRes = $ID > 0;
}
if ($mxRes) {
if (!empty($apply)) {
LocalRedirect("/bitrix/admin/cat_discsave_edit.php?ID=" . $ID . "&mess=ok&lang=" . urlencode(LANGUAGE_ID) . "&" . $tabControl->ActiveTabParam());
} else {
LocalRedirect("/bitrix/admin/cat_discsave_admin.php?lang=" . urlencode(LANGUAGE_ID));
}
} else {
$bVarsFromForm = true;
}
}
}
if ($bVarsFromForm && !empty($arErrors)) {
$obError = new CAdminException($arErrors);