Почему не заполняются пользовательские поля в sale.order.ajax?
Насколько я понял, из коробки оно так не работает, но можно решить обработчиком событий в /bitrix/php_interface/init.php<?php
AddEventHandler("sale", "OnSaleComponentOrderResultPrepared", ['\SaleEvents', "OnSaleComponentOrderResultPrepared"]);
class SaleEvents {
	public static function OnSaleComponentOrderResultPrepared($order, &$user_result, $request, &$params, &$result)
	{
		/**@global \CUser $USER */
		global $USER;
		if ($USER->IsAuthorized()
			&& ($user_info = \Bitrix\Main\UserTable::getList([
				'filter' => [
					'=ID' => $USER->GetID(),
				],
				'select' => [
					'EMAIL',
					'NAME',
					'LAST_NAME',
					'SECOND_NAME',
					'PERSONAL_PHONE',
				],
			])->fetch())
		) {
			foreach($result['JS_DATA']['ORDER_PROP']['properties'] as &$prop) {
				if (!empty(reset($prop['VALUE']))) {
					continue;
				}
				switch($prop['CODE']) {
					case 'EMAIL':
						$prop['VALUE'] = [$user_info['EMAIL']];
						break;
					case 'FIO':
						$name_parts = [];
						foreach([
							'LAST_NAME',
							'NAME',
							'SECOND_NAME',
				        ] as $name_key) {
							if (empty($user_info[$name_key])) {
								continue;
							}
							$name_parts[] = $user_info[$name_key];
						}
						$prop['VALUE'] = [
							implode(' ', $name_parts)
						];
						break;
					case 'PHONE':
						$prop['VALUE'] = [$user_info['PERSONAL_PHONE']];
						break;
				}
			}
			unset($prop);
		}
	}
}
Bx24 не ловит данное событие:
function writeLog($data, $title = 'logs',$file = "/home/bitrix/www/local/apps/sales/app.log")
    {
        $log = "\n------------------------\n";
        $log .= date("Y.m.d G:i:s") . "\n";
        $log .= (strlen($title) > 0 ? $title : 'DEBUG') . "\n";
        $log .= print_r($data, 1);
        $log .= "\n------------------------\n";
        file_put_contents($file, $log, FILE_APPEND);
        return true;
    } 

AddEventHandler("sale", "OnSaleComponentOrderResultPrepared", "onlinePayment");
function onlinePayment($order, &$arUserResult, $request, &$arParams, &$arResult)
{

    
    // order_id 
    $file = "/home/bitrix/www/local/apps/sales/app.log";
 
    
    writeLog($arUserResult,'$user_result',$file); 
    writeLog($arParams,'$params',$file);
    writeLog($arResult,'$result',$file);

    // require_once $_SERVER["DOCUMENT_ROOT"].'/local/apps/sales/onlinePayment.php';
}