Jump to content
Sign in to follow this  

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...