Toggle Nav
My Cart 0

Magento 2 How to assign Guest Order to Customer

Magento 2 How to assign Guest Order to Customer

There are different ways to assign a guest order to the existing customer like, using the extension, using a custom script, and using the database update queries.

Here we are showing you how you can assign a guest order to the customer account from the database.


UPDATE sales_order SET customer_id = {MAGENTO_CUSTOMER_ID}, customer_is_guest = 0 where entity_id = {MAGENTO_ORDER_ID};
UPDATE sales_order_grid SET customer_id = {MAGENTO_CUSTOMER_ID} where entity_id = {MAGENTO_ORDER_ID};

If you have downloadable products in your order then assign that downloadable link to the customer account using the below MYSQL query.


UPDATE downloadable_link_purchased SET customer_id = {MAGENTO_CUSTOMER_ID} WHERE order_id = {MAGENTO_ORDER_ID};

March 3, 2021
Did you like this post?
0
0