本文整理汇总了PHP中Bitrix\Sale\Order::getVatRate方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getVatRate方法的具体用法?PHP Order::getVatRate怎么用?PHP Order::getVatRate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Sale\Order
的用法示例。
在下文中一共展示了Order::getVatRate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertOrderToArray
/**
* @internal
* @param Sale\Order $order
* @return array
*/
public static function convertOrderToArray(Sale\Order $order)
{
$fields = $order->getFieldValues();
//getWeight
$fields = array_merge($fields, array('ORDER_WEIGHT' => 0, 'BASKET_ITEMS' => array(), 'ORDER_PROP' => array(), 'DISCOUNT_LIST' => array(), 'TAX_LIST' => array(), 'VAT_RATE' => $order->getVatRate(), 'VAT_SUM' => $order->getVatSum()));
/** @var Sale\Basket $basket */
if ($basket = $order->getBasket()) {
/** @var Sale\BasketItem $basketItem */
foreach ($basket as $basketItem) {
$fields['BASKET_ITEMS'][] = BasketCompatibility::convertBasketItemToArray($basketItem);
}
}
/** @var Sale\PropertyValueCollection $basket */
if ($propertyCollection = $order->getPropertyCollection()) {
/** @var Sale\PropertyValue $property */
foreach ($propertyCollection as $property) {
// $propertyValue = $property->getValue();
$fields['ORDER_PROP'][$property->getPropertyId()] = $property->getValue();
}
}
if ($propProfileName = $propertyCollection->getProfileName()) {
$fields['PROFILE_NAME'] = $propProfileName->getValue();
}
if ($propPayerName = $propertyCollection->getPayerName()) {
$fields['PAYER_NAME'] = $propPayerName->getValue();
}
if ($propUserEmail = $propertyCollection->getUserEmail()) {
$fields['USER_EMAIL'] = $propUserEmail->getValue();
}
if ($propDeliveryLocationZip = $propertyCollection->getDeliveryLocationZip()) {
$fields['DELIVERY_LOCATION_ZIP'] = $propDeliveryLocationZip->getValue();
}
if ($propDeliveryLocation = $propertyCollection->getDeliveryLocation()) {
$fields['DELIVERY_LOCATION'] = $propDeliveryLocation->getValue();
}
if ($propTaxLocation = $propertyCollection->getTaxLocation()) {
$fields['TAX_LOCATION'] = $propTaxLocation->getValue();
}
/** @var Sale\ShipmentCollection $shipmentCollection */
if ($shipmentCollection = $order->getShipmentCollection()) {
$fields['ORDER_WEIGHT'] = $shipmentCollection->getWeight();
}
$fields['DISCOUNT_LIST'] = DiscountCompatibility::getOldDiscountResult();
/** @var Sale\Tax $tax */
if ($tax = $order->getTax()) {
$fields['TAX_LIST'] = $tax->getTaxList();
}
return $fields;
}