本文整理汇总了PHP中CSaleOrder::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::Delete方法的具体用法?PHP CSaleOrder::Delete怎么用?PHP CSaleOrder::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::Delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnBeforeUserDeleteHandler
function OnBeforeUserDeleteHandler($user_id)
{
\CModule::IncludeModule("iblock");
\CModule::IncludeModule("sale");
//Привязки к соц. сетям
$arrFilter = array("IBLOCK_ID" => USER_SOCIAL_IB, "PROPERTY_USER_ID" => $user_id);
$arSelect = array("ID");
$rsRes = \CIBlockElement::GetList($arOrder, $arrFilter, false, false, $arSelect);
while ($arItem = $rsRes->GetNext()) {
\CIBlockElement::Delete($arItem["ID"]);
}
//Удаляем записи
$result = \Hawkart\Megatv\RecordTable::getList(array('filter' => array("UF_USER_ID" => $user_id), 'select' => array("ID")));
while ($arRecord = $result->fetch()) {
\CRecordEx::delete($arRecord["ID"]);
}
//Удаляем счет
if ($arAccount = \CSaleUserAccount::GetByUserID($user_id, "RUR")) {
\CSaleUserAccount::Delete($arAccount["ID"]);
}
//Удаляем заказы
$arFilter = array("USER_ID" => $user_id);
$db_sales = \CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
while ($ar_sales = $db_sales->Fetch()) {
\CSaleOrder::Delete($ar_sales["ID"]);
}
//Удаляем подписки
$result = \Hawkart\Megatv\SubscribeTable::getList(array('filter' => array("=UF_USER_ID" => $user_id), 'select' => array("ID")));
if ($arSub = $result->fetch()) {
\Hawkart\Megatv\SubscribeTable::delete($arSub["ID"]);
}
}
示例2: bxModifySaleMails
//.........这里部分代码省略.........
while ($arProps_new = $db_props_new->Fetch())
{
//_debug($arProps_new);
foreach($arFields_props_old as $key_props_old=>$item_props_old){
if($arProps_new['CODE']==$key_props_old){
CSaleOrderPropsValue::Update($arProps_new['ID'], array("VALUE"=>$item_props_old['VALUE']));
unset($arFields_props_old[$key_props_old]);
}
}
}
if(sizeof($arFields_props_old)>0){
foreach($arFields_props_old as $key_props_old2=>$item_props_old2){
CSaleOrderPropsValue::Add(array(
'NAME' => $item_props_old2['NAME'],
'CODE' => $item_props_old2['CODE'],
'ORDER_PROPS_ID' => $item_props_old2['ORDER_PROPS_ID'],
'ORDER_ID' => $ORDER_ID,
'VALUE' => $item_props_old2['VALUE']
));
}
}
/**
* добавляем в свойство заказа id партнера для дальнейшей фильтрации по партнерским заказам
*/
CSaleOrderPropsValue::Add(array(
'NAME' => "Привязка по партнеру",
'CODE' => "PATNERID",
'ORDER_PROPS_ID' => 21,
'ORDER_ID' => $ORDER_ID,
'VALUE' => $arFields_partners['ID']
));
//$price_product+=$arProperties_partners['DOSTAVKA']['VALUE'];
//$price_product+=$arFieldsorder_old["PRICE_DELIVERY"];
/**
* отправляем данные о товаре Партнерам
*/
if($arFields_partners['NAME']){ //если есть партнер у товара
$arEventFields = Array(
"ORDER_ID"=> $ORDER_ID,
"ORDER_DATE"=> date("d.m.Y H:i:s"),
"ORDER_USER"=> $arFields_partners['NAME'],
"PRICE"=> $price_product,
"EMAIL"=> $arProperties_partners['EMAIL']['VALUE'],
"ORDER_LIST"=> $products_descriptions,
//"DELIVERY_PRICE"=>$arProperties_partners['DOSTAVKA']['VALUE']
"DELIVERY_PRICE"=>$arFieldsorder_old["PRICE_DELIVERY"]
);
$event = new CEvent;
$event->SendImmediate("SALE_NEW_ORDERPARTNER", SITE_ID, $arEventFields);
}
}
}
// if(!$fail){
// $ar_res_product=CCatalogProduct::GetByID($PRODUCT['ID']);
// $arFields_quant = array(
// 'QUANTITY' => $ar_res_product['QUANTITY']-1
// );
// CCatalogProduct::Update($PRODUCT['ID'], $arFields_quant);
// }
}
}
}
}
/**
* удаляем старый заказ после разбивки на новые
*/
if($ORDER_ID ){
CSaleOrder::Delete($order_id);
}
}
}
$arEventFields = Array(
"ORDER_ID" =>$order_id,
"ORDER_DATE" =>date("d.m.Y H:i:s"),
"ORDER_USER" =>$arUser['NAME'],
"PRICE" =>$price_product,
"EMAIL" => $arUser['EMAIL'],
"ORDER_LIST" =>$products_descriptions,
"DELIVERY_PRICE"=>$arFieldsorder_old["PRICE_DELIVERY"]
);
$event = new CEvent;
$event->SendImmediate("SALE_NEW_BILET", SITE_ID, $arEventFields);
}
}
//$_SESSION['OnBeforeOrderAddHandler']['rows']=$rows;
return false;
}
示例3: Array
}
}
if(empty($arGeneralInfo["properies"][$personType]))
{
$dbProp = CSaleOrderProps::GetList(array(), Array("PERSON_TYPE_ID" => $personType));
while($arProp = $dbProp->Fetch())
$arGeneralInfo["properies"][$personType][$arProp["CODE"]] = $arProp;
}
if(WIZARD_INSTALL_DEMO_DATA)
{
$db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), array("LID" => WIZARD_SITE_ID), false, false, array("ID"));
while ($ar_sales = $db_sales->Fetch())
{
CSaleOrder::Delete($ar_sales["ID"]);
}
}
$arData = Array(
"SITE_ID" => WIZARD_SITE_ID,
"PERSON_TYPE_ID" => $personType,
"CURRENCY" => $defCurrency,
"USER_ID" => 1,
"PAY_SYSTEM_ID" => $paySystem,
//"PRICE_DELIVERY" => "0",
//"DELIVERY_ID" => "",
"PROPS" => Array(),
);
foreach($arGeneralInfo["properies"][$personType] as $key => $val)
{
示例4: GetMessage
}
else
{
switch ($_REQUEST['action'])
{
case "delete":
$arItems = CSaleOrder::GetByID($ID);
if (count($arItems) > 1)
{
@set_time_limit(0);
if (CSaleOrder::CanUserDeleteOrder($ID, $arUserGroups, $intUserID))
{
$DB->StartTransaction();
if (!CSaleOrder::Delete($ID))
{
$DB->Rollback();
if ($ex = $APPLICATION->GetException())
$lAdmin->AddGroupError($ex->GetString(), $ID);
else
$lAdmin->AddGroupError(GetMessage("SALE_DELETE_ERROR"), $ID);
}
else
$DB->Commit();
}
else
{
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SO_NO_PERMS2DEL")), $ID);
}
示例5: Delete
public function Delete($ID)
{
/** @global CUserTypeManager $USER_FIELD_MANAGER */
global $USER_FIELD_MANAGER;
if (!CModule::IncludeModule('sale')) {
return false;
}
$dealID = 0;
$dbResult = CCrmInvoice::GetList(array(), array('ID' => $ID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('ID', 'UF_DEAL_ID'));
$fields = is_object($dbResult) ? $dbResult->Fetch() : null;
if (is_array($fields)) {
$dealID = isset($fields['UF_DEAL_ID']) ? $fields['UF_DEAL_ID'] : 0;
}
$CSaleOrder = new CSaleOrder();
$result = $CSaleOrder->Delete($ID);
if ($result) {
$USER_FIELD_MANAGER->Delete(self::$sUFEntityID, $ID);
CCrmProductRow::DeleteSettings('I', $ID);
self::UnregisterLiveFeedEvent($ID);
CCrmSonetSubscription::UnRegisterSubscriptionByEntity(CCrmOwnerType::Invoice, $ID);
if ($dealID > 0) {
Bitrix\Crm\Statistics\DealInvoiceStatisticEntry::register($dealID);
}
CCrmSearch::DeleteSearch('INVOICE', $ID);
}
return $result;
}
示例6: Delete
public function Delete($ID)
{
/** @global CUserTypeManager $USER_FIELD_MANAGER */
/** @global CMain $APPLICATION */
/** @var CApplicationException $ex */
global $USER_FIELD_MANAGER, $APPLICATION;
$APPLICATION->ResetException();
foreach (GetModuleEvents('crm', 'OnBeforeCrmInvoiceDelete', true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
$err = GetMessage('CRM_INVOICE_DELETE_CANCELED') . ' ' . $arEvent['TO_NAME'];
if ($ex = $APPLICATION->GetException()) {
$err .= ': ' . $ex->GetString();
}
$APPLICATION->throwException($err);
return false;
}
}
if (!CModule::IncludeModule('sale')) {
return false;
}
$dealID = 0;
$dbResult = CCrmInvoice::GetList(array(), array('ID' => $ID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('ID', 'UF_DEAL_ID'));
$fields = is_object($dbResult) ? $dbResult->Fetch() : null;
if (is_array($fields)) {
$dealID = isset($fields['UF_DEAL_ID']) ? $fields['UF_DEAL_ID'] : 0;
}
$CSaleOrder = new CSaleOrder();
$result = $CSaleOrder->Delete($ID);
if ($result) {
$USER_FIELD_MANAGER->Delete(self::$sUFEntityID, $ID);
CCrmProductRow::DeleteSettings('I', $ID);
self::UnregisterLiveFeedEvent($ID);
CCrmSonetSubscription::UnRegisterSubscriptionByEntity(CCrmOwnerType::Invoice, $ID);
if ($dealID > 0) {
Bitrix\Crm\Statistics\DealInvoiceStatisticEntry::register($dealID);
}
CCrmSearch::DeleteSearch('INVOICE', $ID);
foreach (GetModuleEvents('crm', 'OnAfterCrmInvoiceDelete', true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID));
}
}
return $result;
}