本文整理汇总了PHP中CSaleOrderUserProps::DoSaveUserProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderUserProps::DoSaveUserProfile方法的具体用法?PHP CSaleOrderUserProps::DoSaveUserProfile怎么用?PHP CSaleOrderUserProps::DoSaveUserProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderUserProps
的用法示例。
在下文中一共展示了CSaleOrderUserProps::DoSaveUserProfile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
}
if (empty($arErrors))
{
if(!empty($arOrder2Update))
CSaleOrder::Update($ID, $arOrder2Update);
}
}
if ($ID > 0 AND empty($arErrors))
{
//profile saving
$str_USER_ID = intval($str_USER_ID);
if (isset($userProfileID))
{
CSaleOrderUserProps::DoSaveUserProfile($str_USER_ID, $userProfileID, $profileName, $str_PERSON_TYPE_ID, $arOrderPropsValues, $arErrors);
}
unset($user_profile);
//send new order mail
if ($OrderNewSendEmail)
{
$strOrderList = "";
foreach ($arOrder["BASKET_ITEMS"] as $val)
{
if (CSaleBasketHelper::isSetItem($val))
continue;
$measure = (isset($val["MEASURE_TEXT"])) ? $val["MEASURE_TEXT"] : GetMessage("SOA_SHT");
$strOrderList .= $val["NAME"]." - ".$val["QUANTITY"]." ".$measure.": ".SaleFormatCurrency($val["PRICE"], $BASE_LANG_CURRENCY);
$strOrderList .= "\n";
示例2: 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($currentUserId, $arBasketItems["CURRENCY"], $ORDER_ID, $arBasketItems["PRICE"], array(), $arErrors)) {
$urlError = "&erraccount=y";
}
}
CSaleOrderUserProps::DoSaveUserProfile($currentUserId, $PROFILE_ID, $profileName, $PERSON_TYPE, $arPropValues, $arErrors);
LocalRedirect($APPLICATION->GetCurPageParam("ORDER_ID=" . $ORDER_ID . $urlError, array("ORDER_ID", "action", "id")));
} elseif (!empty($arErrors)) {
foreach ($arErrors as $val) {
$errorMessage .= $val . "<br>";
}
}
}
} else {
if (!isset($_POST["BasketOrder"])) {
$errorMessage = "";
}
}
/*********************************************************/
/******************** take basket ************************/
/*********************************************************/
示例3: foreach
if (is_array($_REQUEST["CODE_" . IntVal($arOrderProps["ID"])])) {
foreach ($_REQUEST["CODE_" . IntVal($arOrderProps["ID"])] as $key => $val) {
$curVal .= trim($val);
if ($key < count($_REQUEST["CODE_" . IntVal($arOrderProps["ID"])]) - 1) {
$curVal .= ",";
}
}
}
}
if (($arOrderProps["IS_LOCATION"] == "Y" || $arOrderProps["IS_LOCATION4TAX"] == "Y") && IntVal($curVal) <= 0 || $arOrderProps["IS_ZIP"] == "Y" && strlen($curVal) <= 0 || ($arOrderProps["IS_PROFILE_NAME"] == "Y" || $arOrderProps["IS_PAYER"] == "Y") && strlen($curVal) <= 0 || $arOrderProps["REQUIED"] == "Y" && $arOrderProps["TYPE"] == "LOCATION" && IntVal($curVal) <= 0 || $arOrderProps["REQUIED"] == "Y" && ($arOrderProps["TYPE"] == "TEXT" || $arOrderProps["TYPE"] == "TEXTAREA" || $arOrderProps["TYPE"] == "RADIO" || $arOrderProps["TYPE"] == "SELECT") && strlen($curVal) <= 0 || $arOrderProps["REQUIED"] == "Y" && $arOrderProps["TYPE"] == "MULTISELECT" && strlen($curVal) <= 0) {
$arErrors[] = str_replace("#NAME#", $arOrderProps["NAME"], GetMessage("BUYER_PE_EMPTY_PROPS"));
}
$arOrderPropsValues[$arOrderProps["ID"]] = $curVal;
}
if (count($arErrors) <= 0) {
CSaleOrderUserProps::DoSaveUserProfile($USER_ID, $ID, $profileName, $PERSON_TYPE, $arOrderPropsValues, $arErrors);
}
if (isset($_REQUEST["save"]) && strlen($_REQUEST["save"]) > 0 && count($arErrors) <= 0) {
LocalRedirect("/bitrix/admin/sale_buyers_profile.php?lang=" . LANG . "&USER_ID=" . $USER_ID);
} elseif (isset($_REQUEST["apply"]) && strlen($_REQUEST["apply"]) > 0 && count($arErrors) <= 0) {
LocalRedirect("/bitrix/admin/sale_buyers_profile_edit.php?id=" . $ID . "&lang=" . LANG);
}
}
/*****************************************************************************/
/***************************** FORM EDIT *************************************/
/*****************************************************************************/
if (IntVal($USER_ID) > 0) {
$dbUser = CUser::GetByID($USER_ID);
if ($arUser = $dbUser->Fetch()) {
$userFIO = $arUser["NAME"];
if (strlen($arUser["LAST_NAME"]) > 0) {
示例4: 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']) {
示例5: 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 ************************/
/*********************************************************/
示例6: 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;
}