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


PHP CSaleBasket::DeleteAll方法代码示例

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


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

示例1: OnUserDelete

 function OnUserDelete($userID)
 {
     if ($userID <= 0) {
         return false;
     }
     $arSUser = CSaleUser::GetList(array("USER_ID" => $userID));
     if (!empty($arSUser)) {
         if (!CSaleBasket::DeleteAll($arSUser["ID"])) {
             return false;
         }
         if (!CSaleUser::Delete($arSUser["ID"])) {
             return false;
         }
     }
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:basket.php

示例2: foreach

        foreach ($arRes as $key => $value) {
            $arResult[$key] = $value;
        }
        unset($_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID]);
        if (!empty($_REQUEST["BasketOrder"]) && empty($arResult["WARNING_MESSAGE"])) {
            if (!(strlen($_POST['paypalbutton']) > 0)) {
                LocalRedirect($arParams["PATH_TO_ORDER"]);
            }
        } else {
            unset($_REQUEST["BasketRefresh"], $_REQUEST["BasketOrder"]);
            if (!empty($arResult["WARNING_MESSAGE"])) {
                $_SESSION["SALE_BASKET_MESSAGE"] = $arResult["WARNING_MESSAGE"];
            }
            LocalRedirect($APPLICATION->GetCurPage());
        }
    }
} elseif (!empty($_REQUEST['DeleteAll']) && $_REQUEST['DeleteAll'] == 'Y') {
    CSaleBasket::DeleteAll(CSaleBasket::GetBasketUserID());
    LocalRedirect($APPLICATION->GetCurPage());
}
$basketData = $this->getBasketItems();
$arResult = array_merge($arResult, $basketData);
$arResult["GRID"]["HEADERS"] = $headersData;
if (is_array($_SESSION["SALE_BASKET_MESSAGE"])) {
    foreach ($_SESSION["SALE_BASKET_MESSAGE"] as $message) {
        $arResult["WARNING_MESSAGE"][] = $message;
    }
    unset($_SESSION["SALE_BASKET_MESSAGE"]);
}
CJSCore::Init(array('ajax'));
$this->IncludeComponentTemplate();
开发者ID:AlexPrya,项目名称:redvent.ru,代码行数:31,代码来源:component.php

示例3: DeleteOld

 public static function DeleteOld($nDays)
 {
     global $DB;
     $nDays = IntVal($nDays);
     $strSql = "SELECT f.ID " . "FROM b_sale_fuser f " . "LEFT JOIN b_sale_order o ON (o.USER_ID = f.USER_ID) " . "WHERE " . "\tTO_DAYS(f.DATE_UPDATE)<(TO_DAYS(NOW())-" . $nDays . ") " . "\tAND o.ID is null " . "\tAND f.USER_ID is null " . "LIMIT 300";
     $db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     while ($ar_res = $db_res->Fetch()) {
         CSaleBasket::DeleteAll($ar_res["ID"], false);
         CSaleUser::Delete($ar_res["ID"]);
     }
     return true;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:12,代码来源:basket.php

示例4: AddProduct

    public static function AddProduct ($idProduct, $quantity, $arRewriteFields, $arProductParams, $userId, $currency, $personType, $clearCart) {
		if (CModule::IncludeModule("catalog")) {
			
			global $DB;
			global $USER;
				
			if ($clearCart == "Y" && (int)$idProduct > 0) {
				CSaleBasket::DeleteAll(CSaleBasket::GetBasketUserID());
			}
			
			if (Add2BasketByProductID( $idProduct, $quantity, $arRewriteFields, $arProductParams)) { // В корзину
			
				// Получаю параметры корзины
				$dbBasketItems = CSaleBasket::GetList(array("NAME" => "ASC", "ID" => "ASC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "ORDER_ID" => "NULL"), false, false, array("ID", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "PRICE", "NAME"));
				while ($arItems = $dbBasketItems->Fetch())	{
						$arBasketItems[] = $arItems;
				}
				
				foreach ($arBasketItems as $valBasketItems) {
					$productPriceSumm = $productPriceSumm + ((int)$valBasketItems["QUANTITY"]*(int)$valBasketItems["PRICE"]);
				}
				
				
				$strOrderList = "";

				foreach ($arBasketItems as $arItem)
				{
					$measureText = (isset($arItem["MEASURE_TEXT"]) && strlen($arItem["MEASURE_TEXT"])) ? $arItem["MEASURE_TEXT"] : GetMessage("SOA_SHT");

					$strOrderList .= $arItem["NAME"]." - ".$arItem["QUANTITY"]." ".$measureText.": ".SaleFormatCurrency($arItem["PRICE"], $arItem["CURRENCY"]);
					$strOrderList .= "\n";
				}
				
				
				// Создаю заказ
				$arOrderFields = array(
					"LID" => SITE_ID,
					"PERSON_TYPE_ID" => $personType,
					"PAYED" => "N",
					"CANCELED" => "N",
					"STATUS_ID" => "N",
					"PRICE" => $productPriceSumm,
					"CURRENCY" => $currency,
					"USER_ID" => $userId,
					"USER_DESCRIPTION" => "",
					"ADDITIONAL_INFO" => ""
				);
				
				$ORDER_ID = CSaleOrder::Add($arOrderFields);
				
				// Привязываем товары из корзины текущего пользователя к заказу			
				
				CSaleBasket::OrderBasket($ORDER_ID, CSaleBasket::GetBasketUserID(), SITE_ID, false);

				$rsUser = CUser::GetByID($userId);
				$arUser = $rsUser->Fetch();
				
				$arFields = Array(
					"ORDER_ID" => $ORDER_ID,
					"ORDER_DATE" => Date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT", SITE_ID))),
					"ORDER_USER" => $arUser["NAME"],
					"PRICE" => $productPriceSumm,
					"BCC" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME),
					"EMAIL" => (strlen($arUserResult["USER_EMAIL"])>0 ? $arUserResult["USER_EMAIL"] : $USER->GetEmail()),
					"ORDER_LIST" => $strOrderList,
					"SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME),
						
				);

				$eventName = "SALE_NEW_ORDER";

					$event = new CEvent;
					$event->Send($eventName, SITE_ID, $arFields, "N");
					
				
				return $ORDER_ID;
				
			}

			
		} else {
			return false;
		}
	}
开发者ID:ASDAFF,项目名称:order_click,代码行数:84,代码来源:class.php

示例5: orderHistory


//.........这里部分代码省略.........
                             $arProduct['DISCOUNT_VALUE'] = $item['discountPercent'];
                             $newPrice = round($arProduct['PRICE'] / 100 * (100 - $arProduct['DISCOUNT_VALUE']), 2);
                             $arProduct['DISCOUNT_PRICE'] = $arProduct['DISCOUNT_PRICE'] + $arProduct['PRICE'] - $newPrice;
                         }
                         if (isset($item['discount']) || isset($item['discountPercent'])) {
                             $arProduct['PRICE'] -= $arProduct['DISCOUNT_PRICE'];
                         }
                         if (isset($item['offer']['name']) && $item['offer']['name']) {
                             $arProduct['NAME'] = self::fromJSON($item['offer']['name']);
                         }
                         $arProduct = self::updateCancelProp($arProduct, 0);
                     } elseif (isset($item['isCanceled'])) {
                         $arProduct['PRICE'] = 0;
                         $arProduct = self::updateCancelProp($arProduct, 1);
                     }
                     if (isset($item['created']) && $item['created'] == true) {
                         if (!Add2BasketByProductID($item['offer']['externalId'], $item['quantity'], $arProduct, $p['PROPS'])) {
                             self::eventLog('ICrmOrderActions::orderHistory', 'Add2BasketByProductID', 'Error element add');
                         }
                         continue;
                     }
                     if (count($p['PROPS']) > 0) {
                         $arProduct['PROPS'] = $p['PROPS'];
                     }
                     if (isset($item['quantity']) && $item['quantity']) {
                         $arProduct['QUANTITY'] = $item['quantity'];
                     }
                     if (isset($item['offer']['name']) && $item['offer']['name']) {
                         $arProduct['NAME'] = self::fromJSON($item['offer']['name']);
                     }
                     if (!CSaleBasket::Update($p['ID'], $arProduct)) {
                         self::eventLog('ICrmOrderActions::orderHistory', 'CSaleBasket::Update', 'Error element update');
                     }
                     CSaleBasket::DeleteAll($userId);
                 } else {
                     $arProduct = array();
                     if (isset($item['created']) && $item['created'] == true) {
                         $arProduct = array('FUSER_ID' => $userId, 'ORDER_ID' => $order['externalId'], 'LID' => $LID, 'NOTES' => $item['comment']);
                     }
                     if (isset($item['isCanceled']) == false) {
                         if (isset($item['initialPrice']) && $item['initialPrice']) {
                             $arProduct['PRICE'] = (double) $item['initialPrice'];
                         }
                         if (isset($item['discount'])) {
                             $arProduct['DISCOUNT_PRICE'] = $item['discount'];
                         }
                         if (isset($item['discountPercent'])) {
                             $arProduct['DISCOUNT_VALUE'] = $item['discountPercent'];
                             $newPrice = round($arProduct['PRICE'] / 100 * (100 - $arProduct['DISCOUNT_VALUE']), 2);
                             $arProduct['DISCOUNT_PRICE'] = $arProduct['DISCOUNT_PRICE'] + $arProduct['PRICE'] - $newPrice;
                         }
                         if (isset($item['discount']) || isset($item['discountPercent'])) {
                             $arProduct['PRICE'] -= $arProduct['DISCOUNT_PRICE'];
                         }
                         if (isset($item['offer']['name']) && $item['offer']['name']) {
                             $arProduct['NAME'] = self::fromJSON($item['offer']['name']);
                         }
                         $arProduct = self::updateCancelProp($arProduct, 0);
                     } elseif (isset($item['isCanceled'])) {
                         $arProduct['PRICE'] = 0;
                         $arProduct = self::updateCancelProp($arProduct, 1);
                     }
                     if (isset($item['quantity']) && $item['quantity']) {
                         $arProduct['QUANTITY'] = $item['quantity'];
                     }
                     if (isset($item['offer']['name']) && $item['offer']['name']) {
开发者ID:Ksenobyte,项目名称:bitrix-module,代码行数:67,代码来源:ICrmOrderActions.php

示例6: resetBasket

 /**
  * Delete all products from current user's basket
  * @return boolean
  */
 public static function resetBasket()
 {
     CSaleBasket::DeleteAll(CSaleBasket::GetBasketUserID());
     return true;
 }
开发者ID:ASDAFF,项目名称:bitrix-snippets,代码行数:9,代码来源:class.SaleHelper.php


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