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


PHP CCatalogDiscount::ClearCoupon方法代码示例

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


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

示例1: OnBasketAddHandler

function OnBasketAddHandler($ID, $arFields)
{
    global $USER;
    \Bitrix\Main\Loader::includeModule('catalog');
    \Bitrix\Main\Loader::includeModule('sale');
    if ($USER->IsAuthorized()) {
        $arFilter = array("USER_ID" => $USER->GetID());
        $db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
        $arrCount = [];
        while ($ar_sales = $db_sales->Fetch()) {
            $arrCount[] = $ar_sales;
        }
        if (is_array($arrCount) == false) {
            $res = CCatalogDiscount::SetCoupon('SL-CDUEA-HI8MMPY');
            //3%
        } else {
            if (count($arrCount) >= 1) {
                $resClean = CCatalogDiscount::ClearCoupon('SL-CDUEA-HI8MMPY');
                $res5 = CCatalogDiscount::SetCoupon('SL-0JG2C-XIHBEYZ');
                //5%
            } else {
            }
        }
    } else {
        $res = CCatalogDiscountCoupon::SetCoupon('SL-CDUEA-HI8MMPY');
        //3%
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:28,代码来源:CCatalogDiscount.php

示例2: htmlspecialcharsbx

}
$arParams["COUNT_DISCOUNT_4_ALL_QUANTITY"] = $arParams["COUNT_DISCOUNT_4_ALL_QUANTITY"] == "Y" ? "Y" : "N";
//$arParams['PRICE_VAT_INCLUDE'] = $arParams['PRICE_VAT_INCLUDE'] == 'N' ? 'N' : 'Y';
$arParams['PRICE_VAT_SHOW_VALUE'] = $arParams['PRICE_VAT_SHOW_VALUE'] == 'N' ? 'N' : 'Y';
$arParams["WEIGHT_UNIT"] = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', "", SITE_ID));
$arParams["WEIGHT_KOEF"] = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, SITE_ID));
$arResult["WARNING_MESSAGE"] = array();
$GLOBALS['CATALOG_ONETIME_COUPONS_BASKET'] = null;
$GLOBALS['CATALOG_ONETIME_COUPONS_ORDER'] = null;
if (strlen($_REQUEST["BasketRefresh"]) > 0 || strlen($_REQUEST["BasketOrder"]) > 0) {
    if ($arParams["HIDE_COUPON"] != "Y") {
        $COUPON = Trim($_REQUEST["COUPON"]);
        if (strlen($COUPON) > 0) {
            CCatalogDiscount::SetCoupon($COUPON);
        } else {
            CCatalogDiscount::ClearCoupon();
        }
    }
    $dbBasketItems = CSaleBasket::GetList(array("PRICE" => "DESC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => "NULL"), false, false, array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "CURRENCY", "SUBSCRIBE"));
    while ($arBasketItems = $dbBasketItems->Fetch()) {
        $arBasketItems['QUANTITY'] = $arParams['QUANTITY_FLOAT'] == 'Y' ? DoubleVal($arBasketItems['QUANTITY']) : IntVal($arBasketItems['QUANTITY']);
        if (!isset($_REQUEST["QUANTITY_" . $arBasketItems["ID"]])) {
            $quantityTmp = $arBasketItems['QUANTITY'];
        } else {
            $quantityTmp = $arParams['QUANTITY_FLOAT'] == 'Y' ? DoubleVal($_REQUEST["QUANTITY_" . $arBasketItems["ID"]]) : IntVal($_REQUEST["QUANTITY_" . $arBasketItems["ID"]]);
        }
        $deleteTmp = $_REQUEST["DELETE_" . $arBasketItems["ID"]] == "Y" ? "Y" : "N";
        $delayTmp = $_REQUEST["DELAY_" . $arBasketItems["ID"]] == "Y" ? "Y" : "N";
        if ($deleteTmp == "Y" && in_array("DELETE", $arParams["COLUMNS_LIST"])) {
            if ($arBasketItems["SUBSCRIBE"] == "Y" && is_array($_SESSION["NOTIFY_PRODUCT"][$USER->GetID()])) {
                unset($_SESSION["NOTIFY_PRODUCT"][$USER->GetID()][$arBasketItems["PRODUCT_ID"]]);
开发者ID:,项目名称:,代码行数:31,代码来源:


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