In Expresso Store, is it possible to connect orders placed by a guest to a member account with the same email address? The scenario is that a guest places an order, then later wants to create a member account on the site. It would be great to be able to then connect all their previous guest orders to that new member account.
1 Answer
Hi directly in the built in system - however, the only thing that relates an order to a member is a single column representing member_id. You could write a small extension to simply iterate through all orders with member_id=0 and query the members table to update them.
Shouldn't take more than an hours work.
Just to flesh this out a little - you should be able to do it with a query pretty close to this:
update exp_store_orders o set o.member_id = (select member_id from exp_members where email = o.order_email) where o.member_id = 0;
That's untested SQL BTW, but should give you a headstart.
-
1Thanks @madebyhippo. That is what I was thinking would probably be needed. I'll whip something up. Apr 22, 2015 at 18:33
-
1Store should automatically assign previous guest orders to a newly created member account for you, if a user registers for an account while checking out on another order without the need for an additional extension Apr 22, 2015 at 19:20
-
1@JustinLong That did not work for me in my testing. What I did was place some orders as a guest. Later I registered on the site using Freemember using the same email address that I previously placed the orders with. The previous guest orders did not connect. Perhaps that only works if I user the register_member option in Store and as part of the order process? Apr 23, 2015 at 19:14
-
1Yea it only works if you register a member through Store while completing an order. Apr 23, 2015 at 20:10