本文整理汇总了PHP中CSaleOrderUserProps类的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderUserProps类的具体用法?PHP CSaleOrderUserProps怎么用?PHP CSaleOrderUserProps使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSaleOrderUserProps类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Delete
function Delete($ID)
{
global $DB;
$ID = IntVal($ID);
$db_orderProps = CSaleOrderProps::GetList($by = "PROPS_GROUP_ID", $order = "ASC", array("PROPS_GROUP_ID" => $ID));
while ($arOrderProps = $db_orderProps->Fetch()) {
$DB->Query("DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = " . $arOrderProps["ID"] . "", true);
$DB->Query("UPDATE b_sale_order_props_value SET ORDER_PROPS_ID = NULL WHERE ORDER_PROPS_ID = " . $arOrderProps["ID"] . "", true);
$DB->Query("DELETE FROM b_sale_user_props_value WHERE ORDER_PROPS_ID = " . $arOrderProps["ID"] . "", true);
}
$DB->Query("DELETE FROM b_sale_order_props WHERE PROPS_GROUP_ID = " . $ID . "", true);
CSaleOrderUserProps::ClearEmpty();
return $DB->Query("DELETE FROM b_sale_order_props_group WHERE ID = " . $ID . "", true);
}
示例2: OnAfterUserUpdateHandler
function OnAfterUserUpdateHandler(&$arFields)
{
CModule::IncludeModule('sale');
global $USER;
$profile = CSaleOrderUserProps::GetList(array("DATE_UPDATE" => "DESC"), array("USER_ID" => $arFields['ID']))->Fetch();
$PROFILE_ID = $profile['ID'];
//если профиль создан
if ($PROFILE_ID)
{
//формируем массив свойств
$props = array(
$PROFILE_ID => array(
"USER_PROPS_ID" => $PROFILE_ID,
"NAME" => "Адрес доставки",
"VALUE" => $arFields['PERSONAL_STREET']
)
);
//добавляем значения свойств к созданному ранее профилю
foreach ($props as $propId => $prop) {
$x = CSaleOrderUserPropsValue::Update($propId, $prop);
}
}
}
示例3: Delete
function Delete($ID)
{
global $DB;
$ID = IntVal($ID);
$DB->Query("DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = " . $ID . "", true);
$DB->Query("UPDATE b_sale_order_props_value SET ORDER_PROPS_ID = NULL WHERE ORDER_PROPS_ID = " . $ID . "", true);
$DB->Query("DELETE FROM b_sale_user_props_value WHERE ORDER_PROPS_ID = " . $ID . "", true);
CSaleOrderUserProps::ClearEmpty();
return $DB->Query("DELETE FROM b_sale_order_props WHERE ID = " . $ID . "", true);
}
示例4: Delete
/**
* <p>Функция удаляет свойство с кодом ID заказа. Существующие в базе значения этого свойства отвязываются от удаляемого свойства. Удаляются связанные значения из профиля покупателя. </p>
*
*
*
*
* @param int $ID Код удаляемого свойства.
*
*
*
* @return bool <p>Возвращается <i>true</i> в случае успешного удаления и <i>false</i> - в
* случае ошибки.</p> <a name="examples"></a>
*
*
* <h4>Example</h4>
* <pre>
* <?
* if (!CSaleOrderProps::Delete(12))
* echo "Ошибка удаления свойства";
* ?>
* </pre>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/sale/classes/csaleorderprops/csaleorderprops__delete.75442e5e.php
* @author Bitrix
*/
public static function Delete($ID)
{
global $DB;
$ID = intval($ID);
if ($ID <= 0) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeOrderPropsDelete", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
return false;
}
}
$DB->Query("DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = " . $ID, true);
$DB->Query("UPDATE b_sale_order_props_value SET ORDER_PROPS_ID = NULL WHERE ORDER_PROPS_ID = " . $ID, true);
$DB->Query("DELETE FROM b_sale_user_props_value WHERE ORDER_PROPS_ID = " . $ID, true);
$DB->Query("DELETE FROM b_sale_order_props_relation WHERE PROPERTY_ID = " . $ID, true);
CSaleOrderUserProps::ClearEmpty();
foreach (GetModuleEvents("sale", "OnOrderPropsDelete", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID));
}
return $DB->Query("DELETE FROM b_sale_order_props WHERE ID = " . $ID, true);
}
示例5: saveProfileData
public static function saveProfileData($profileId, Order $order, array $formData)
{
$result = new Result();
$errors = array();
if (!($profileName = $order->getPropertyCollection()->getProfileName())) {
$result->addError(new EntityError(Loc::getMessage("SALE_ORDEREDIT_PROFILE_ERROR_NAME")));
return $result;
}
$res = \CSaleOrderUserProps::DoSaveUserProfile($order->getUserId(), $profileId, $profileName->getValue(), $order->getPersonTypeId(), $propCollection = $formData["PROPERTIES"], $errors);
if ($res === false) {
if (!empty($errors)) {
foreach ($errors as $error) {
$result->addError(new EntityError($error . "<br>\n"));
}
} else {
$result->addError(new EntityError(Loc::getMessage("SALE_ORDEREDIT_PROFILE_ERROR_SAVE")));
}
}
return $result;
}
示例6: strlen
if (strlen($errorMessage) > 0)
$bInitVars = True;
if (strlen($_POST["save"]) > 0 && strlen($errorMessage) <= 0)
LocalRedirect($arParams["PATH_TO_LIST"]);
elseif(strlen($_POST["apply"]) > 0 && strlen($errorMessage) <= 0)
LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_DETAIL"], Array("ID" => $ID)));
}
$arResult["ORDER_PROPS"] = Array();
$dbUserProps = CSaleOrderUserProps::GetList(
array("DATE_UPDATE" => "DESC"),
array(
"ID" => $ID,
"USER_ID" => IntVal($GLOBALS["USER"]->GetID())
),
false,
false,
array("ID", "NAME", "USER_ID", "PERSON_TYPE_ID", "DATE_UPDATE")
);
if ($arUserProps = $dbUserProps->GetNext())
{
if(!$bInitVars)
$arResult = $arUserProps;
else
{
foreach($_POST as $k => $v)
{
$arResult[$k] = htmlspecialcharsbx($v);
$arResult['~'.$k] = $v;
}
示例7: intval
CRMModeOutput($result);
}
/*
* profile autocomplete script
*/
if (isset($userId) AND isset($buyerType) AND isset($profileDefault))
{
$userId = intval($userId);
$buyerType = intval($buyerType);
$profileDefault = intval($profileDefault);
$arPropValuesTmp = array();
$userProfile = array();
$userProfile = CSaleOrderUserProps::DoLoadProfiles($userId, $buyerType);
if ($profileDefault != "" AND $profileDefault != "0")
$arPropValuesTmp = $userProfile[$profileDefault]["VALUES"];
$dbVariants = CSaleOrderProps::GetList(
array("SORT" => "ASC"),
array(
"PERSON_TYPE_ID" => $buyerType,
"USER_PROPS" => "Y",
"ACTIVE" => "Y",
"RELATED" => false
)
);
while ($arVariants = $dbVariants->Fetch())
{
if (isset($arPropValuesTmp[$arVariants["ID"]]))
示例8: fUserProfile
function fUserProfile($USER_ID, $BUYER_TYPE = '', $default = '')
{
$userProfileSelect = "<select name=\"user_profile\" id=\"user_profile\" onChange=\"fChangeProfile(this);\">";
$userProfileSelect .= "<option value=\"0\">".GetMessage("NEWO_BUYER_PROFILE_NEW")."</option>";
$userProfile = CSaleOrderUserProps::DoLoadProfiles($USER_ID, $BUYER_TYPE);
$i = "";
if (!empty($userProfile) && is_array($userProfile))
{
foreach($userProfile as $key => $val)
{
if ($default == "" AND $i == "")
{
$userProfileSelect .= "<option selected value=\"".$key."\">".$val["NAME"]."</option>";
$i = $key;
}
elseif ($default == $key)
$userProfileSelect .= "<option selected value=\"".$key."\">".$val["NAME"]."</option>";
else
$userProfileSelect .= "<option value=\"".$key."\">".$val["NAME"]."</option>";
}
}
$userProfileSelect .= "</select>";
return $userProfileSelect;
}
示例9: array
if ($psPreAction && $psPreAction->IsAction()) {
$psPreAction->orderId = $arResult["ORDER_ID"];
$psPreAction->orderAmount = $orderTotalSum;
$psPreAction->deliveryAmount = $arResult["DELIVERY_PRICE"];
$psPreAction->taxAmount = $arResult["TAX_PRICE"];
$orderData = array();
$dbBasketItems = CSaleBasket::GetList(array("ID" => "ASC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => $arResult["ORDER_ID"]), false, false, array("ID", "QUANTITY", "PRICE", "WEIGHT", "NAME", "CURRENCY", "PRODUCT_ID", "DETAIL_PAGE_URL"));
while ($arItem = $dbBasketItems->Fetch()) {
$orderData['BASKET_ITEMS'][] = $arItem;
}
$psPreAction->payOrder($orderData);
}
}
}
if (empty($arResult["ERROR"])) {
CSaleOrderUserProps::DoSaveUserProfile($USER->GetID(), $arUserResult["PROFILE_ID"], $arUserResult["PROFILE_NAME"], $arUserResult["PERSON_TYPE_ID"], $arUserResult["ORDER_PROP"], $arResult["ERROR"]);
}
// mail message
if (empty($arResult["ERROR"])) {
$i = 0;
$strOrderList = "";
$arBasketList = array();
$dbBasketItems = CSaleBasket::GetList(array("ID" => "ASC"), array("ORDER_ID" => $arResult["ORDER_ID"]), false, false, array("ID", "PRODUCT_ID", "NAME", "QUANTITY", "PRICE", "CURRENCY", "TYPE", "SET_PARENT_ID"));
while ($arItem = $dbBasketItems->Fetch()) {
if (CSaleBasketHelper::isSetItem($arItem)) {
continue;
}
$arFilter = array("ID" => IntVal($arItem['PRODUCT_ID']));
$res = CIBlockElement::GetList(array(), $arFilter, false, false, array("ID", "IBLOCK_ID", "PREVIEW_PICTURE", 'DETAIL_PICTURE'));
while ($ar_fields = $res->GetNext()) {
if ($ar_fields['PREVIEW_PICTURE']) {
示例10: intval
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
if (isset($hrpd->MerchantInternalPaymentId)) {
if ($hrpd->ErrorCode == 0) {
if (CModule::IncludeModule('sale')) {
$order_id = intval($hrpd->MerchantInternalPaymentId);
if ($arOrder = CSaleOrder::GetByID(IntVal($order_id))) {
CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
$urlGetMerchantInfo = 'http://payment.kaznachey.net/api/PaymentInterface/CreatePayment';
$urlGetClientMerchantInfo = 'http://payment.kaznachey.net/api/PaymentInterface/GetMerchatInformation';
$merchantGuid = CSalePaySystemAction::GetParamValue("MerchantId");
$merchnatSecretKey = CSalePaySystemAction::GetParamValue("SecretKey");
$order_id = IntVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"]);
$selectedPaySystemId = 1;
$quantitys = 0;
$order_info = CSaleOrder::GetByID($order_id);
$user_info = CSaleOrderUserProps::GetByID($order_info['USER_ID']);
$user_fullinfo = CSaleOrderUserPropsValue::GetByID($order_info['USER_ID']);
$user_email = $USER->GetParam("EMAIL");
$user_id = $order_info['USER_ID'];
$amount = number_format($order_info['PRICE'], 2, '.', '');
$dbBasketItems = CSaleBasket::GetList(array(), array("ORDER_ID" => $order_id));
while ($arItems = $dbBasketItems->Fetch()) {
$quantitys += $arItems['QUANTITY'];
}
if ($order_info['PRICE_DELIVERY'] > 0) {
$quantitys += 1;
}
$quantitys = number_format($quantitys, 2, '.', '');
$signature_u = md5(md5($merchantGuid . $merchnatSecretKey . "{$amount}" . "{$quantitys}" . $order_id));
if ($hrpd->CustomMerchantInfo == $signature_u) {
$arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $out_summ, "PS_CURRENCY" => "", "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
示例11: getBuyerProfilesList
public static function getBuyerProfilesList($userId, $personTypeId = null)
{
$result = array(0 => Loc::getMessage("SALE_ORDER_BUYER_CREATE_NEW"));
if (intval($userId) > 0) {
$profiles = \CSaleOrderUserProps::DoLoadProfiles($userId);
if (is_array($profiles)) {
foreach ($profiles as $types) {
foreach ($types as $key => $value) {
$result[$key] = htmlspecialcharsback($value["NAME"]);
}
}
}
}
return $result;
}
示例12: CAdminSorting
//END MAIN INFO
//BUYERS PROFILE
$sTableID_tab2 = "tbl_sale_buyers_profile_tab2";
$oSort_tab2 = new CAdminSorting($sTableID_tab2);
$lAdmin_tab2 = new CAdminList($sTableID_tab2, $oSort_tab2);
$arPErsonTypes = array();
$db_ptype = CSalePersonType::GetList($by1 = "SORT", $order1 = "ASC");
while ($ptype = $db_ptype->Fetch()) {
$arPErsonTypes[$ptype["ID"]] = $ptype;
}
if (!isset($_REQUEST["by"])) {
$arProfSort = array("PERSON_TYPE_ID" => "ASC", "DATE_UPDATE" => "DESC");
} else {
$arProfSort[$by] = $order;
}
$dbProfileList = CSaleOrderUserProps::GetList($arProfSort, array("USER_ID" => $ID), false, false, array("ID", "NAME", "PERSON_TYPE_ID", "DATE_UPDATE"));
$dbProfileList = new CAdminResult($dbProfileList, $sTableID_tab2);
$dbProfileList->NavStart();
$lAdmin_tab2->NavText($dbProfileList->GetNavPrint(GetMessage('BUYER_PERSON_LIST')));
$personHeader = array(array("id" => "NAME", "content" => GetMessage("BUYER_P_NAME"), "sort" => "NAME", "default" => true), array("id" => "PERSON_TYPE_ID", "content" => GetMessage("BUYER_P_PERSONTYPE"), "sort" => "PERSON_TYPE_ID", "default" => true), array("id" => "DATE_UPDATE", "content" => GetMessage("BUYER_P_DATE_UPDATE"), "sort" => "DATE_UPDATE", "default" => true));
$lAdmin_tab2->AddHeaders($personHeader);
while ($arProfList = $dbProfileList->GetNext()) {
$row =& $lAdmin_tab2->AddRow($arProfList["ID"], $arProfList, "sale_buyers_profile_edit.php?id=" . $arProfList["ID"] . "&lang=" . LANG, GetMessage("BUYER_P_PROFILE_EDIT"));
$row->AddField("NAME", "[" . $arProfList["ID"] . "] <a href=\"/bitrix/admin/sale_buyers_profile_edit.php?id=" . $arProfList["ID"] . "&lang=" . LANG . "\">" . $arProfList["NAME"] . "</a>");
$row->AddField("PERSON_TYPE_ID", htmlspecialcharsbx($arPErsonTypes[$arProfList["PERSON_TYPE_ID"]]["NAME"]));
if (count($arSites) > 1) {
$row->AddField("LID", "[" . $arProfList["LID"] . "] " . htmlspecialcharsbx($arSites[$arProfList["LID"]]["NAME"]) . "");
}
}
if ($_REQUEST["table_id"] == $sTableID_tab2) {
$lAdmin_tab2->CheckListMode();
示例13: LocalRedirect
$event1 = "eStore";
$event2 = "order_confirm";
$event3 = $arResult["ORDER_ID"];
$e = $event1 . "/" . $event2 . "/" . $event3;
if (!is_array($_SESSION["ORDER_EVENTS"]) || is_array($_SESSION["ORDER_EVENTS"]) && !in_array($e, $_SESSION["ORDER_EVENTS"])) {
CStatistic::Set_Event($event1, $event2, $event3);
$_SESSION["ORDER_EVENTS"][] = $e;
}
}
$urlError = "";
if ($PAYSYSTEM_ID == "account") {
if (!CSaleUserAccount::DoPayOrderFromAccount($USER->GetID(), $arBasketItems["CURRENCY"], $ORDER_ID, $arBasketItems["PRICE"], array(), $arErrors)) {
$urlError = "&erraccount=y";
}
}
CSaleOrderUserProps::DoSaveUserProfile($USER->GetID(), $PROFILE_ID, $profileName, $PERSON_TYPE, $arPropValues, $arErrors);
LocalRedirect($APPLICATION->GetCurPageParam("ORDER_ID=" . $ORDER_ID . $urlError, array("ORDER_ID", "action", "id")));
} elseif (count($arErrors) > 0) {
foreach ($arErrors as $val) {
$errorMessage .= $val . "<br>";
}
}
}
} else {
if (!isset($_POST["BasketOrder"])) {
$errorMessage = "";
}
}
/*********************************************************/
/******************** take basket ************************/
/*********************************************************/
示例14: CAdminResult
if(!CSaleOrderUserProps::Update($ID, $arFields))
$lAdmin->AddGroupError(GetMessage("ws.saleuserprofiles_save_error").$cData->LAST_ERROR, $ID);
}
else
$lAdmin->AddGroupError(GetMessage("ws.saleuserprofiles_save_error")." ".GetMessage("ws.saleuserprofiles_no_profile"), $ID);
break;*/
}
}
}
// ******************************************************************** //
// ВЫБОРКА ЭЛЕМЕНТОВ СПИСКА //
// ******************************************************************** //
// выберем список профилей пользователей
$rsData = CSaleOrderUserProps::GetList(array($by=>$order), $arFilter);
//$arData = array();
//while ($arRes = $rsData->Fetch()) {
// $arData[] = $arRes;
//}
// преобразуем список в экземпляр класса CAdminResult
//$rsData = new CDBResult;
$rsData = new CAdminResult($rsData, $sTableID);
//$rsData->InitFromArray($arData);
// аналогично CDBResult инициализируем постраничную навигацию.
$rsData->NavStart();
示例15: OnUserDelete
public static function OnUserDelete($ID)
{
$ID = IntVal($ID);
$db_res = CSaleOrderUserProps::GetList($b = "ID", $o = "ASC", array("USER_ID" => $ID));
while ($ar_res = $db_res->Fetch()) {
CSaleOrderUserProps::Delete(IntVal($ar_res["ID"]));
}
return True;
}