本文整理汇总了PHP中Bitrix\Sale\Order::getDeliveryPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getDeliveryPrice方法的具体用法?PHP Order::getDeliveryPrice怎么用?PHP Order::getDeliveryPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Sale\Order
的用法示例。
在下文中一共展示了Order::getDeliveryPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBasePrice
public static function getBasePrice(Order $order)
{
return $order->getPrice() - $order->getTaxValue() - $order->getDiscountPrice() - $order->getDeliveryPrice();
}
示例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;
}
示例3: 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;
}