D
D
Dima2019-05-23 11:20:04
WordPress
Dima, 2019-05-23 11:20:04

How to display the order in the profile if the registration is after the purchase?

Now the logic is this. When placing an order, a person enters soap and after a successful purchase, generates a password and registers a person. But in the order history in the personal account there is no already paid purchase.
Purchases are displayed in the personal account from the user id.
How to make it display the product that the user bought before registration?
PS in ordering a wokomers is also an oddity. there is an order from the person who bought it and his mail, but when looking for a user by mail in the wokomers admin panel, he does not find a single order, although the mail goes both as mail and as a nickname and as a name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Nikolaev, 2019-05-23
@nikolaevevge

Add a required e-mail field to the cart page (in the place of checkout). When placing an order, if there are no problems and errors (that is, in a situation where the order will definitely be accepted), first register the user, then link the order to him in the same handler, and after placing the order, write that a personal account has been created and that the login data sent by e-mail.
If a user with such an e-mail address is already in the system, then the order is linked to his account.
Just recently I made such a login for an online store on Bitrix.
________________________________________
Or another option. Revise the logic of displaying the list of orders in the personal account, so that the binding is not by id, but by e-mail.
That is, you bind the order for authorized ones to the e-mail that they have in the personal account, and if not authorized, then to the e-mail that is entered when ordering.
Thus, if such a user creates a personal account in the future, orders will be displayed that were linked by e-mail.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question