• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/actions.php
  • Класс: BitrixSaleDiscountActions
  • Вызов: Actions::fillCompatibleFields
static function fillCompatibleFields(array &$order)
{
	$adminSection = MainContext::getCurrent()->getRequest()->isAdminSection();
	if (empty($order) || !is_array($order))
		return;
	if (!empty($order['BASKET_ITEMS']) && is_array($order['BASKET_ITEMS']))
	{
		foreach ($order['BASKET_ITEMS'] as &$item)
		{
			if (isset($item['PRICE_DEFAULT']))
				$item['PRICE_DEFAULT'] = $item['PRICE'];
			if ($adminSection)
				continue;

			foreach (self::$compatibleBasketFields as &$fieldName)
			{
				if (array_key_exists($fieldName, $item) && !is_array($item[$fieldName]))
					$item['~'.$fieldName] = $item[$fieldName];
			}
			unset($fieldName);
		}
		unset($item);
	}
}