Hi all, if a customer has always checked out as a guest in the past, and now decides to register. Is there a way to attach their old orders to their new registration?
We have a customer now who has ordered 3 times in the past. Today she registered an account (with the same email address) and I would like to link her past orders to her newly registered account.
A SQL query would be the most efficient way to do it. Below is NOT tested but intended to show how to do it. It should be tested on a copy of your database before executing it on any kind of live server.
UPDATE cscart_orders AS o SET o.user_id=u.user_id
INNER JOIN cscart_users AS u ON u.email = o.email
WHERE o.user_id=0
THIS HAS NOT BEEN TESTED and is for demonstration purposes only.
I've only got a single storefront where I don't ?think? it would matter, but shouldn't there be a 'and o.company_id = u.company_id' added to the joins in those queries?