Jump to content
rnewcomer

Move Historical Orders to Different User

Recommended Posts

Good morning....

As I have mentioned in the past, I have a closed and captive customer base at about 60 different locations.  Once a user from a certain location leaves (for whatever reason), we disable their "login" then eventually delete their "customer" login.

Problem that that will raise... we cannot delete while they have order history.  Which is good, because if we just deleted them, we would lose this data.  So, is there a way to move this historical data from the location's "terminated" customer to the location's new customer?

FYI - "terminated" customer's account is disabled to prevent logins.

Thanks for any help.

Share this post


Link to post
Share on other sites

So, just to clarify:

* Disabling a customer isn't sufficient?
* You are not 'moving' customer X's "history" from site A to site B, but rather 'renaming' expiring customer X to customer Z at site A?
* Where customer Z is a "catch-all" for all customers being 'deleted' at site A?

The CubeCart_customer table has a 'customer_id' field, which is referenced by CubeCart_addressbook, CubeCart_order_summary, CubeCart_customer_membership (special pricing), and CubeCart_customer_subscriber tables, as well as any third-party plugins that deal with customer info.

Removing an historical record from a database is generally not a "best practice", but if that's what you want to do...

You will need to create Customer Y and identify the 'customer_id' of it.

You will need to identify the customer_id of Customer X and make a query to change it to that of Y:

UPDATE CubeCart_customer SET customer_id = YY WHERE customer_id = XX

for those tables relevant to your situation.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×