Jump to content

[solved] Need to Merge Two Customer Accounts


Recommended Posts

I have a customer who registered and ordered with one email address. Subsequent to that order, he registered with his new email address and ordered with his new email address. Is there a way I can merge his old account / orders with his new account so everything shows up with his new email login?

 

Edit: I used brute force approach with phpmyadmin access to database. I located and changed the id_customer filed in the various database tables associated with the old email address to that associated with the new email address. I located the following tables that have the id_customer field (ps_customer has the master id_customer filed):

(all prefaced with ps_): address, cart, customer_group, customer_thread, message, orders, order_return, order_slip

  • Thanks 1
Link to comment
Share on other sites

  • 6 years later...
  • 1 year later...
  • 3 years later...

I have done it by database queries. Let's say the customer ID 123 is the customer that I want to keep. The next customers ids 501, 502, 503 will be merged with 123 id. Make sure you have all tables in your database, some tables are created by plugins, for sample ps_simpleblog_comment and ps_psgdpr_log. Make a full backup of your database before making any changes.

update ps_address                        set id_customer=123 WHERE id_customer in (501,502,503);
update ps_cart                           set id_customer=123 WHERE id_customer in (501,502,503);
update ps_cart_rule                      set id_customer=123 WHERE id_customer in (501,502,503);
update ps_customer_session               set id_customer=123 WHERE id_customer in (501,502,503);
update ps_customer_thread                set id_customer=123 WHERE id_customer in (501,502,503);
update ps_favorite_product               set id_customer=123 WHERE id_customer in (501,502,503);
update ps_guest                          set id_customer=123 WHERE id_customer in (501,502,503);
update ps_mailalert_customer_oos         set id_customer=123 WHERE id_customer in (501,502,503);
update ps_message                        set id_customer=123 WHERE id_customer in (501,502,503);
update ps_orders                         set id_customer=123 WHERE id_customer in (501,502,503);
update ps_order_return                   set id_customer=123 WHERE id_customer in (501,502,503);
update ps_order_slip                     set id_customer=123 WHERE id_customer in (501,502,503);
update ps_product_comment                set id_customer=123 WHERE id_customer in (501,502,503);
update ps_product_comment_report         set id_customer=123 WHERE id_customer in (501,502,503);
update ps_product_comment_usefulness     set id_customer=123 WHERE id_customer in (501,502,503);
update ps_psgdpr_log                     set id_customer=123 WHERE id_customer in (501,502,503);
update ps_simpleblog_comment             set id_customer=123 WHERE id_customer in (501,502,503);
update ps_specific_price                 set id_customer=123 WHERE id_customer in (501,502,503);
update ps_ws_wishlist                    set id_customer=123 WHERE id_customer in (501,502,503);

delete from ps_customer                where id_customer in (501,502,503);
delete from ps_customer_group          where id_customer in (501,502,503);

  • Like 1
Link to comment
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
×
×
  • Create New...