当前位置: 首页>>代码示例>>PHP>>正文


PHP Order::getPrice方法代码示例

本文整理汇总了PHP中Bitrix\Sale\Order::getPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getPrice方法的具体用法?PHP Order::getPrice怎么用?PHP Order::getPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Sale\Order的用法示例。


在下文中一共展示了Order::getPrice方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:14,代码来源:orderfinanceinfo.php

示例2: 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;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:36,代码来源:ordercompatibility.php

示例3: getBasePrice

 public static function getBasePrice(Order $order)
 {
     return $order->getPrice() - $order->getTaxValue() - $order->getDiscountPrice() - $order->getDeliveryPrice();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:orderbasket.php

示例4: getTotalPrices

 public static function getTotalPrices(Order $order, OrderBasket $orderBasket, $needRecalculate = true)
 {
     $result = array('PRICE_TOTAL' => $order->getPrice(), 'TAX_VALUE' => $order->getTaxValue(), 'PRICE_DELIVERY_DISCOUNTED' => $order->getDeliveryPrice(), 'SUM_PAID' => $order->getSumPaid());
     $result["SUM_UNPAID"] = $result["PRICE_TOTAL"] - $result["SUM_PAID"];
     if (!$result["PRICE_DELIVERY_DISCOUNTED"]) {
         $result["PRICE_DELIVERY_DISCOUNTED"] = 0;
     }
     if (!$result["TAX_VALUE"]) {
         $result["TAX_VALUE"] = 0;
     }
     $orderDiscount = $order->getDiscount();
     if ($orderDiscount) {
         $discountsList = self::getDiscountsApplyResult($order, $needRecalculate);
     } else {
         $discountsList = array();
     }
     if (isset($discountsList["PRICES"]["DELIVERY"]["DISCOUNT"])) {
         $result['DELIVERY_DISCOUNT'] = $discountsList["PRICES"]["DELIVERY"]["DISCOUNT"];
     } else {
         $result['DELIVERY_DISCOUNT'] = 0;
     }
     $result['PRICE_DELIVERY'] = $result['PRICE_DELIVERY_DISCOUNTED'] + $result['DELIVERY_DISCOUNT'];
     $basketData = $orderBasket->prepareData(array("DISCOUNTS" => $discountsList));
     $result["PRICE_BASKET_DISCOUNTED"] = $basketData["BASKET_PRICE"];
     $result["PRICE_BASKET"] = $basketData["BASKET_PRICE_BASE"];
     return $result;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:27,代码来源:orderedit.php

示例5: fillEmptyOrderData

 /**
  * Fill empty order data.
  *
  * @param Order $order			Order object.
  * @return void
  */
 protected function fillEmptyOrderData(Order $order)
 {
     $this->orderData = array('ID' => $order->getId(), 'USER_ID' => $order->getUserId(), 'SITE_ID' => $order->getSiteId(), 'ORDER_PRICE' => $order->getPrice(), 'ORDER_WEIGHT' => 0, 'CURRENCY' => $order->getCurrency(), 'PERSON_TYPE_ID' => $order->getPersonTypeId(), 'BASKET_ITEMS' => array(), 'PRICE_DELIVERY' => 0, 'PRICE_DELIVERY_DIFF' => 0, 'DELIVERY_ID' => 0, 'CUSTOM_PRICE_DELIVERY' => 'N', 'SHIPMENT_CODE' => 0, 'SHIPMENT_ID' => 0);
     $paymentCollection = $order->getPaymentCollection();
     /** @var Payment $payment */
     foreach ($paymentCollection as $payment) {
         if ($payment->isInner()) {
             continue;
         }
         if (!isset($this->orderData['PAY_SYSTEM_ID'])) {
             $this->orderData['PAY_SYSTEM_ID'] = $payment->getPaymentSystemId();
             break;
         }
     }
     unset($payment, $paymentCollection);
     if (!isset($this->orderData['PAY_SYSTEM_ID'])) {
         $this->orderData['PAY_SYSTEM_ID'] = 0;
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:25,代码来源:discount.php

示例6: fillEmptyOrderData

 /**
  * Fill empty order data.
  *
  * @param Order $order			Order object.
  * @return void
  */
 protected function fillEmptyOrderData(Order $order)
 {
     $this->orderData = array('ID' => $order->getId(), 'USER_ID' => $order->getUserId(), 'SITE_ID' => $order->getSiteId(), 'ORDER_PRICE' => $order->getPrice(), 'ORDER_WEIGHT' => 0, 'CURRENCY' => $order->getCurrency(), 'BASKET_ITEMS' => array(), 'PRICE_DELIVERY' => 0, 'PRICE_DELIVERY_DIFF' => 0, 'DELIVERY_ID' => 0, 'CUSTOM_PRICE_DELIVERY' => 'N', 'SHIPMENT_CODE' => 0, 'SHIPMENT_ID' => 0);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:10,代码来源:discount.php


注:本文中的Bitrix\Sale\Order::getPrice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。