A
A
Aricus2022-02-03 17:52:27
1C-Bitrix
Aricus, 2022-02-03 17:52:27

Where is the user created when placing an order in 1s-Bitrix?

I need to change user save at checkout: add custom field values ​​and middle name. The bitrix:sale.order.ajax component, which I copied and am trying to modify, is responsible for placing an order. Creating a user in the component is in the SaleOrderAjax->registerAndLogIn() function, however, a change in it does not affect the saved user. I added a log entry to each component function. Here is a list of functions that are used immediately after clicking on the "Checkout" button:

onPrepareComponentParams
executeComponent
prepareAction
doAction
actionExists
showOrderAction
scaleImages

That is, registerAndLogIn does not enter the user registration function. As it does not enter any of the functions of the chain from which registerAndLogIn is called (the chain breaks at one of the two protected functions).
The user is created somewhere else, but authorization does not occur. Can you please tell me how to find the place where the user is created without understanding in detail how the component of 6500 lines works?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tgarl, 2022-02-03
@Aricus

Registration takes place in the /bitrix/components/bitrix/sale.order.ajax/class.php component itself, and not in its template.
In addition, when ordering, there are 2 entities: user and buyer profile.
The user is the one who registers, usually there is a minimum of data (login, name, mail, if I don’t confuse anything), and his order profile is the data that is filled in at the time of placing the order.
And these data can vary greatly from order to order. Because I, as a user, can place one order for a colleague's work, a second one for a relative, but not even a single order for myself. Therefore, during registration, a minimum of data is taken to set up an account, the rest is stored separately, and then only if you set up saving fields in a profile and allow the use of profiles when ordering.
If you want to fill in user data from the order fields, then the simpler solution in my opinion would be to use order save events. than rewriting a component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question