- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/notify.php
- Класс: BitrixSaleNotify
- Вызов: Notify::getOrderFields
static function getOrderFields(Order $order)
{
$fields = $order->getFieldValues();
$fields = array_merge($fields,
array(
'ORDER_ID' => $order->getId(),
'ORDER_WEIGHT' => 0,
'BASKET_ITEMS' => array(),
'ORDER_PROP' => array(),
'DISCOUNT_LIST' => array(),
'TAX_LIST' => array(),
'VAT_RATE' => $order->getVatRate(),
'VAT_SUM' => $order->getVatSum(),
));
/** @var Basket $basket */
if ($basket = $order->getBasket())
{
/** @var BasketItem $basketItem */
foreach ($basket as $basketItem)
{
$fields['BASKET_ITEMS'][] = static::getBasketItemFields($basketItem);
}
$fields['ORDER_WEIGHT'] = $basket->getWeight();
}
/** @var PropertyValueCollection $basket */
if ($propertyCollection = $order->getPropertyCollection())
{
/** @var PropertyValue $property */
foreach ($propertyCollection as $property)
{
$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();
}
$fields['DISCOUNT_LIST'] = CompatibleDiscountCompatibility::getOldDiscountResult();
/** @var Tax $tax */
if ($tax = $order->getTax())
{
$fields['TAX_LIST'] = $tax->getTaxList();
}
return $fields;
}