How to Assign an Woocommerce Order to Customer Programmatically

How do I assign the order to a customer?

You can use “update_post_meta” to update customer id of the order

$orderid = 1;
$userid = 1;

update_post_meta($orderid, '_customer_user', $userid);
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments