good day
The site has a minimally customized component of the order, the user fills in 5 fields, one of them is a phone, but this number is not stored in the user profile.
I tried to write a handler, but it didn’t work for me, I almost didn’t come across them and I had so-so php I tried to use this:

<? AddEventHandler("sale", "OnBeforeOrderAdd", "OnBeforeOrderAdd"); function OnBeforeOrderAdd(&$arProps) { // echo "<pre>"; // print_r($arProps); // echo "</pre>"; // die(); global $USER; $userID = $USER->GetID(); $user = new CUser; $fields = Array( "PERSONAL_PHONE" => $arProps['ORDER_PROP']['3'], ); $user->Update($userID, $fields); } ?> 

I suppose that at the moment of the handler's triggering, the user is not yet authorized and it is impossible to get out $userID = $USER->GetID();
The $arProps['ORDER_PROP']['3'] stores the phone number entered by the user.
In the settings of the store Properties order-> list of properties-> The phone is ticked in the profile, the property group "personal data"

  • And if you use the default component, everything works as it should? - Nikolaj Sarry
  • No, yes, and I customized only the visual part - Nyarlath0tep
  • And in the admin of the property phone tick included in the profile? - Nikolaj Sarry
  • Yes, I specially checked, I thought it should work initially - Nyarlath0tep
  • Then I advise you to write in tech support. - Nikolaj Sarry

0