Register Customer after first checkout

Les Girvan asked on February 25, 2022 13:59

Hi

We have recently enabled guest checkout on our ecommerce site as described here (https://docs.xperience.io/k11/e-commerce-features/configuring-your-store/checkout-process/enabling-automatic-registration-for-anonymous-customers) and we would like to know if it is possible to get access to the logic which automatically generates the user account so that we can add an additional value into the Usersettings.UserCustomdata field?

Thanks Les

Recent Answers


Brian McKeiver answered on February 26, 2022 22:19

In a quick look, I don't think it is possible to customize the behavior of what that checkbox does. It simply copies customer data over to user data (looks like name, email, and phone only) and sets the password. I think you would need to add your own logic in after the checkout step that waits for (or eecutes after) the default behavior to finish, and then run your own logic to populate the UserCustomData field. Or disable that setting and handle your own conversion of Customer to User where you could control all of it.

0 votesVote for this answer Mark as a Correct answer

Les Girvan answered on February 26, 2022 23:43

Hi Brian

Thanks for your email, can you please advise how I can add in custom logic for the checkout step? Or do you know if it is possible to retrieve a users password from the database?

Thanks Les

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on February 27, 2022 18:38

Les, here is the documentation for adding a custom event to an object (which would be the customer or user object you could attach to either). https://docs.xperience.io/k11/custom-development/handling-global-events/handling-object-events. This would execute any time a user is created for anywhere if you go this route.

I don't quite know if you have portal engine or MVC, but I'm guessing portal engine because of V11. For that you might need to clone the ecommerce module or web part for the step you have, and write code into the .ascx file where it makes the most sense, but that is a lot of work. I would need to know more about your setup to say for sure.

No, it is not possible to read a user's password from the DB (in plain text anyways), that would be a security risk. You can set it (write to it) as much as you want though.

0 votesVote for this answer Mark as a Correct answer

Les Girvan answered on February 28, 2022 17:09

Hi Brian, we are using v11 portal engine, we need to store the generated password as an encrypted value in the Usersettings UserCustomData field as we need the users password to sync up with external EPOS system. Can you please advise the best place to do this that as we need to intercept the generated password before it is saved to the database?

Thanks Les

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.