Answer the question
In order to leave comments, you need to log in
How to split the FIO order property into separate fields?
The store has created a FULL NAME checkout property.
The person enters three words respectively. Bitrix correctly enters only the First Name and Last Name into the user profile. Middle name is not recorded in the user profile. Why?
I decided to try to break the full name through the API in init.php and specify this data in the corresponding profile fields. But it doesn't work.
If you simply write some data to the standard fields (for example, a login to be an email), then it works like this:
AddEventHandler("main", "OnBeforeUserAdd", "OnAfterUserAddHandler");
function OnAfterUserAddHandler(&$arFields){
$arFields["LOGIN"] = $arFields["EMAIL"];
}
Answer the question
In order to leave comments, you need to log in
Look here
bxapi.ru/src/?module_id=sale&name=CSaleUser::DoAut...
Well, the component itself. somewhere 168 line.
By default, you have a string that is broken by a space, and, accordingly, the Patronymic name is not recorded.
As a crutch, you can try to pass an array here via $_REQUEST
$_REQUEST['CODE_PROPERTY_TYPE_NAME_USER'] = ['NAME' => 'IVAN', 'FIRST_NAME' => 'IVANOV', 'SECOND_NAME' => 'IVANOVICH']
CODE_PROPERTY_TYPE_NAME_USER - property code actually from which the name of the new user is taken.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question