本文整理汇总了PHP中CSaleOrder::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::getById方法的具体用法?PHP CSaleOrder::getById怎么用?PHP CSaleOrder::getById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::getById方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOrderInfo
protected static function getOrderInfo($orderId)
{
// order itself
$order = \CSaleOrder::getById($orderId);
// buyer info
$siteUserId = $order['USER_ID'];
$phone = '';
$email = '';
$result = \CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId));
while ($row = $result->fetch()) {
if (empty($phone) && stripos($row['CODE'], 'PHONE') !== false) {
$stPhone = static::normalizePhoneNumber($row['VALUE']);
if (!empty($stPhone)) {
$phone = sha1($stPhone);
}
}
if (empty($email) && stripos($row['CODE'], 'EMAIL') !== false) {
if (!empty($row['VALUE'])) {
$email = sha1($row['VALUE']);
}
}
}
// products info
$products = array();
$result = \CSaleBasket::getList(array(), $arFilter = array('ORDER_ID' => $orderId), false, false, array('PRODUCT_ID'));
while ($row = $result->fetch()) {
$products[] = array('product_id' => $row['PRODUCT_ID'], 'recommendation' => '0');
}
// all together
$data = array('order_id' => $orderId, 'user_id' => $siteUserId, 'phone' => $phone, 'email' => $email, 'products' => $products);
return $data;
}
示例2: unserialize
$bUserCanViewOrder = CSaleOrder::CanUserViewOrder($ID, $arUserGroups, $intUserID);
$bUserCanEditOrder = CSaleOrder::CanUserUpdateOrder($ID, $arUserGroups);
$bUserCanCancelOrder = CSaleOrder::CanUserCancelOrder($ID, $arUserGroups, $intUserID);
$bUserCanDeductOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_DEDUCTION", $arUserGroups);
$bUserCanMarkOrder = CSaleOrder::CanUserMarkOrder($ID, $arUserGroups, $intUserID);
$bUserCanPayOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_PAYMENT", $arUserGroups);
$bUserCanDeliverOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_DELIVERY", $arUserGroups);
$bUserCanDeleteOrder = CSaleOrder::CanUserDeleteOrder($ID, $arUserGroups, $intUserID);
if (isset($_REQUEST["ORDER_AJAX"]) AND $_REQUEST["ORDER_AJAX"] == "Y" AND check_bitrix_sessid())
{
CUtil::DecodeUriComponent($_REQUEST);
$type = $_REQUEST["type"];
$order = CSaleOrder::getById($ID);
$allowIds = \Bitrix\Main\Config\Option::get("sale", "p2p_status_list", "");
if(strlen($allowIds))
$allowIds = unserialize($allowIds);
else
$allowIds = array();
/*
* get more product
*/
if (isset($type) && $type != "")
{
$arResult = array();
$arErrors = array();
$LID = (array_key_exists('LID', $_REQUEST))? ($_REQUEST['LID']) : false;
示例3: getOrderInfo
protected static function getOrderInfo($orderId)
{
// order itself
$order = \CSaleOrder::getById($orderId);
// buyer info
$siteUserId = $order['USER_ID'];
$phone = '';
$email = '';
$result = \CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId));
while ($row = $result->fetch()) {
if (empty($phone) && stripos($row['CODE'], 'PHONE') !== false) {
$stPhone = static::normalizePhoneNumber($row['VALUE']);
if (!empty($stPhone)) {
$phone = sha1($stPhone);
}
}
if (empty($email) && stripos($row['CODE'], 'EMAIL') !== false) {
if (!empty($row['VALUE'])) {
$email = sha1($row['VALUE']);
}
}
}
// products info
$products = array();
$result = \CSaleBasket::getList(array(), $arFilter = array('ORDER_ID' => $orderId, 'MODULE' => 'catalog'), false, false, array('PRODUCT_ID', 'RECOMMENDATION', 'QUANTITY', 'PRICE', 'CURRENCY'));
while ($row = $result->fetch()) {
$productInfo = \CCatalogSKU::GetProductInfo($row['PRODUCT_ID']);
$iblockId = 0;
if (!empty($productInfo['ID'])) {
$realProductId = $productInfo['ID'];
$iblockId = $productInfo['IBLOCK_ID'];
} else {
$realProductId = $row['PRODUCT_ID'];
// get iblock id
$element = \Bitrix\Iblock\ElementTable::getRow(array('select' => array('IBLOCK_ID'), 'filter' => array('=ID' => $realProductId)));
if (!empty($element)) {
$iblockId = $element['IBLOCK_ID'];
}
}
$products[] = array('product_id' => $realProductId, 'iblock_id' => $iblockId, 'quantity' => $row['QUANTITY'], 'price' => $row['PRICE'], 'currency' => $row['CURRENCY'], 'recommendation' => $row['RECOMMENDATION']);
}
// all together
$data = array('order_id' => $orderId, 'user_id' => $siteUserId, 'phone' => $phone, 'email' => $email, 'products' => $products, 'price' => $order['PRICE'], 'currency' => $order['CURRENCY']);
return $data;
}
示例4: ksort
}
} else {
$key = CSalePaySystemAction::GetParamValue("API_PASSWORD");
if (isset($_SERVER['HTTP_X_API_SIGNATURE']) && strlen($key) > 0) {
$key = CSalePaySystemAction::GetParamValue("API_PASSWORD");
$params = $_POST;
ksort($params);
$check = base64_encode(sha1($key, implode("|", array_values($params))));
if ($check != $_SERVER['HTTP_X_API_SIGNATURE']) {
qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_AUTH);
}
} else {
qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_AUTH);
}
}
if ($order = CSaleOrder::getById($_POST['bill_id'])) {
$paidInfo = array("PS_STATUS" => $_POST['status'] == "paid" ? "Y" : "N", "PS_STATUS_CODE" => substr($_POST['status'], 0, 5), "PS_STATUS_MESSAGE" => Loc::getMessage("SALE_QWH_STATUS_MESSAGE_" . strtoupper($_POST['status'])), "PS_RESPONSE_DATE" => \Bitrix\Main\Type\DateTime::createFromTimestamp(time()), "PS_SUM" => (double) $_POST['amount'], "PS_CURRENCY" => $_POST['ccy'], "PS_STATUS_DESCRIPTION" => "");
if ((int) $_POST['error']) {
$paidInfo['PS_STATUS_DESCRIPTION'] = "Error: " . Loc::getMessage("SALE_QWH_ERROR_CODE_" . $_POST['error']);
CSaleOrder::Update($order['ID'], $paidInfo);
qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_OTHER);
}
foreach ($_POST as $key => $value) {
$paidInfo['PS_STATUS_DESCRIPTION'] .= "{$key}:{$value}, ";
}
CSaleOrder::Update($order['ID'], $paidInfo);
$changeStatusPay = CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY") == "Y";
$difference = (double) $_POST['amount'] - (double) $order['PRICE'];
if ($difference < 0) {
qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_TOO_LOW);
} elseif ($difference > 0) {