本文整理汇总了PHP中Bitrix\Sale\Order::getField方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getField方法的具体用法?PHP Order::getField怎么用?PHP Order::getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Sale\Order
的用法示例。
在下文中一共展示了Order::getField方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareData
public static function prepareData(Order $order)
{
$currencyBudget = 0;
if ($order->getUserId() > 0) {
$res = \CSaleUserAccount::getList(array(), array('USER_ID' => $order->getUserId(), 'CURRENCY' => $order->getCurrency(), 'LOCKED' => 'N'), false, false, array('CURRENT_BUDGET'));
$userAccount = $res->Fetch();
$currencyBudget = $userAccount['CURRENT_BUDGET'];
}
$payable = $order->getPrice() - $order->getSumPaid();
$price = $order->getPrice();
$sumPaid = $order->getSumPaid();
$data = array('PRICE' => $price ? $price : 0, 'SUM_PAID' => $sumPaid ? $sumPaid : 0, 'PAYABLE' => $payable >= 0 ? $payable : 0, 'CURRENCY' => $order->getCurrency(), 'BUYER_BUDGET' => $currencyBudget, 'STATUS_ID' => $order->getField('STATUS_ID'));
return $data;
}
示例2: getView
public static function getView(Order $order, OrderBasket $orderBasket, $selectPayment = null, $selectId = null)
{
// prepare data
$orderId = $order->getId();
$data = $orderBasket->prepareData();
$items = $data['ITEMS'];
$documents = array();
$itemNo = 0;
/** @var \Bitrix\Sale\Payment $payment */
foreach ($order->getPaymentCollection() as $payment) {
$documents[] = $payment;
}
/** @var \Bitrix\Sale\Shipment $shipment */
foreach ($order->getShipmentCollection() as $shipment) {
if (!$shipment->isSystem()) {
if (!$shipment->isCanceled() && $shipment->isShipped()) {
/** @var \Bitrix\Sale\ShipmentItem $shipmentItem */
foreach ($shipment->getShipmentItemCollection() as $shipmentItem) {
$basketItem = $shipmentItem->getBasketItem();
if (isset($items[$basketItem->getBasketCode()])) {
$item =& $items[$basketItem->getBasketCode()];
if ($shippedQuantity =& $item['SHIPPED_QUANTITY']) {
$shippedQuantity += (double) $shipmentItem->getField('QUANTITY');
} else {
$shippedQuantity = (double) $shipmentItem->getField('QUANTITY');
}
}
}
}
$documents[] = $shipment;
}
}
unset($item, $shippedQuantity);
usort($documents, array(__CLASS__, 'sortDocumentsByDate'));
// render view
ob_start();
?>
<div class="adm-s-order-table-ddi">
<table class="adm-s-order-table-ddi-table adm-s-bus-ordertable-option" style="width: 100%;">
<thead>
<tr>
<td class="tac"><?php
echo Loc::getMessage('SALE_OANALYSIS_ITEM_NUMBER');
?>
</td>
<td><?php
echo Loc::getMessage('SALE_OANALYSIS_ITEM_NAME');
?>
</td>
<td class="tac"><?php
echo Loc::getMessage('SALE_OANALYSIS_ITEM_PROPERTIES');
?>
</td>
<td class="tac"><?php
echo Loc::getMessage('SALE_OANALYSIS_ITEM_PLANNED');
?>
</td>
<td class="tac"><?php
echo Loc::getMessage('SALE_OANALYSIS_ITEM_SHIPPED');
?>
</td>
<td class="tac"><?php
echo Loc::getMessage('SALE_OANALYSIS_ITEM_TO_SHIP');
?>
</td>
</tr>
</thead>
<tbody>
<?php
foreach ($items as $item) {
$properties = '<table style="margin: auto; width: 50%;">';
if (is_array($item['SKU_PROPS'])) {
foreach ($item['SKU_PROPS'] as $skuProp) {
$properties .= '<tr>';
$properties .= '<td style="text-align: left;">' . htmlspecialcharsbx($skuProp['NAME']) . ' : ' . '</td>';
if (isset($skuProp['VALUE']['PICT']) && $skuProp['VALUE']['PICT']) {
$properties .= '<td><span class="color"><img src="' . $skuProp['VALUE']['PICT'] . '" alt=""></span></td>';
} else {
$properties .= '<td><span>' . htmlspecialcharsbx($skuProp['VALUE']['NAME']) . '</span></td>';
}
$properties .= '</tr>';
}
}
$properties .= '</table>';
if (!($quantity = (double) $item['QUANTITY'])) {
$quantity = 0;
}
if (!($shippedQuantity = $item['SHIPPED_QUANTITY'])) {
$shippedQuantity = 0;
}
?>
<tr class="bdb-line">
<td class="tac"><?php
echo ++$itemNo;
?>
</td>
<td style="text-align: left;"><a class="fwb" href="<?php
echo $item['EDIT_PAGE_URL'];
?>
"><?php
//.........这里部分代码省略.........
示例3: getOrderFields
/**
* @param Sale\Order $order
*
* @return array
*/
public static function getOrderFields(Sale\Order $order)
{
$result = new Sale\Result();
$paymentSystemId = false;
$deliveryId = false;
/** @var Sale\PaymentCollection $paymentCollection */
if ($paymentCollection = $order->getPaymentCollection()) {
/** @var Sale\Payment $payment */
if ($payment = $paymentCollection->rewind()) {
$paymentSystemId = $payment->getPaymentSystemId();
}
}
/** @var Sale\ShipmentCollection $shipe */
if ($shipmentCollection = $order->getShipmentCollection()) {
/** @var Sale\Shipment $shipment */
foreach ($shipmentCollection as $shipment) {
if ($shipment->getDeliveryId() > 0) {
$deliveryId = $shipment->getDeliveryId();
break;
}
}
}
$fields = array("SITE_ID" => $order->getSiteId(), "LID" => $order->getSiteId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "PRICE" => $order->getPrice(), "CURRENCY" => $order->getCurrency(), "USER_ID" => $order->getUserId(), "PAY_SYSTEM_ID" => $paymentSystemId, "PRICE_DELIVERY" => $order->getDeliveryPrice(), "DELIVERY_ID" => $deliveryId, "DISCOUNT_VALUE" => $order->getDiscountPrice(), "TAX_VALUE" => $order->getTaxValue(), "TRACKING_NUMBER" => $order->getField('TRACKING_NUMBER'), "PAYED" => $order->getField('PAYED'), "CANCELED" => $order->getField('CANCELED'), "STATUS_ID" => $order->getField('STATUS_ID'), "RESERVED" => $order->getField('RESERVED'));
$orderFields = static::convertOrderToArray($order);
if (is_array($orderFields)) {
$orderFields = $fields + $orderFields;
$orderFields = static::convertDateFieldsToOldFormat($orderFields);
}
$result->setData(array('FIELDS' => $fields, 'ORDER_FIELDS' => $orderFields));
return $result;
}
示例4: getScripts
public static function getScripts(Order $order, $userId)
{
$langPhrases = array("SALE_ORDER_STATUS_SAVE", "SALE_ORDER_STATUS_CANCEL", "SALE_ORDER_STATUS_CHANGE_ERROR", "SALE_ORDER_STATUS_CANCEL_ERROR", "SALE_ORDER_STATUS_CANCEL_CANCEL", "SALE_ORDER_STATUS_CHANGED_SUCCESS", "SALE_ORDER_STATUS_CANCELED", "SALE_ORDER_STATUS_CANCELING");
$result = '
<script type="text/javascript">
BX.ready(function(){
BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters({
STATUS_ID: {
callback: BX.Sale.Admin.OrderEditPage.setStatus,
context: this
}
});
BX.Sale.Admin.OrderEditPage.statusesNames = ' . \CUtil::PhpToJSObject(self::getStatusesList($userId, $order->getField('STATUS_ID'))) . ';
BX.Sale.Admin.OrderEditPage.callFieldsUpdaters(' . \CUtil::PhpToJSObject(self::prepareData($order)) . ');';
foreach ($langPhrases as $phrase) {
$result .= ' BX.message({' . $phrase . ': "' . \CUtil::JSEscape(Loc::getMessage($phrase)) . '"});';
}
$result .= '}); </script>';
return $result;
}
示例5: prepareData
public static function prepareData(Order $order)
{
$result = array("USER_ID" => $order->getUserId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "BUYER_USER_NAME" => OrderEdit::getUserName($order->getUserId()), "USER_DESCRIPTION" => $order->getField("USER_DESCRIPTION"));
return $result;
}
示例6: prepareData
protected static function prepareData(Order $order)
{
static $result = null;
if ($result === null) {
$creator = static::getUserInfo($order->getField("CREATED_BY"));
$creatorName = $creator["LOGIN"];
if (strlen($creator["NAME"]) > 0) {
$creatorName = $creator["NAME"] . " (" . $creatorName . ")";
}
$canceler = static::getUserInfo($order->getField("EMP_CANCELED_ID"));
$cancelerName = $canceler["LOGIN"];
if (strlen($canceler["NAME"]) > 0) {
$cancelerName = $canceler["NAME"] . " (" . $cancelerName . ")";
}
$result = array("DATE_INSERT" => $order->getDateInsert()->toString(), "DATE_UPDATE" => $order->getField('DATE_UPDATE')->toString(), "CREATOR_USER_NAME" => $creatorName, "CREATOR_USER_ID" => $creator["ID"], "STATUS_ID" => $order->getField('STATUS_ID'), "CANCELED" => $order->getField("CANCELED"), "EMP_CANCELED_NAME" => $cancelerName);
}
return $result;
}
示例7: prepareData
public static function prepareData(Order $order)
{
if (\CBXFeatures::IsFeatureEnabled('SaleAccounts')) {
$strBuyerProfileUrl = '/bitrix/admin/sale_buyers_profile.php?USER_ID=' . $order->getUserId() . '&lang=' . LANGUAGE_ID;
} else {
$strBuyerProfileUrl = '/bitrix/admin/user_edit.php?ID=' . $order->getUserId() . '&lang=' . LANGUAGE_ID;
}
$result = array("USER_ID" => $order->getUserId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "BUYER_USER_NAME" => OrderEdit::getUserName($order->getUserId()), "USER_DESCRIPTION" => $order->getField("USER_DESCRIPTION"), "BUYER_URL" => $strBuyerProfileUrl);
return $result;
}