Answer the question
In order to leave comments, you need to log in
Why doesn't init work in Bitrix?
An event was created when adding a user through 1C to remove External=sale
In init.php :
AddEventHandler("main", "OnAfterUserRegister", "OnBeforeUserRegisterHandler");
function OnBeforeUserRegisterHandler(&$arFields)
{
if(isset($arFields['EXTERNAL_AUTH_ID']))
unset($arFields['EXTERNAL_AUTH_ID']);
$arProfileFields = array(
"NAME" => "Профиль покупателя (".$arFields['LOGIN'].')',
"USER_ID" => $arFields['USER_ID'],
"PERSON_TYPE_ID" => 3
);
$PROFILE_ID = CSaleOrderUserProps::Add($arProfileFields);
if ($PROFILE_ID)
{
$PROPS=Array(
array(
"USER_PROPS_ID" => $PROFILE_ID,
"ORDER_PROPS_ID" => 15,
"NAME" => "Телефон",
"VALUE" => $arFields['WORK_PHONE']
),
array(
"USER_PROPS_ID" => $PROFILE_ID,
"ORDER_PROPS_ID" => 9,
"NAME" => "Ф.И.О.",
"VALUE" => $arFields['LAST_NAME'].' '.$arFields['NAME'].' '.$arFields['SECOND_NAME']
)
);
foreach ($PROPS as $prop)
CSaleOrderUserPropsValue::Add($prop);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question