Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question