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


PHP CCatalogDiscountSave::Add方法代碼示例

本文整理匯總了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);
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:cat_discsave_edit.php


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