Im creating a WooCommerce order programmatically trough a form and I link the order trough the user id:
$order->set_customer_id( $user_id );
I retrieve the customer information via mail instead of ID:
$user = get_user_by( 'email', $email );
Is it possible to link the order to an existing customer via the existing email instead of the user id? Something like this:
$order->set_customer_id( $email );
Is this possible?