Hello I would to add the User_ID to WooCommerce order confirmation emails. I want my customers to be able to see their own USER ID number in the email that they receive after placing an order.
But I'm having a problem with my current code.
This is my current code:
<?php global $current_user;
get_currentuserinfo();
echo 'Your membership number: ' . $current_user->ID . "\n";
?>
But the problem is that this is not specific to the User ID of the actual order. This User ID grabs the ID of the logged in user, instead of the User ID of the user who placed the order.
It should maybe contain something like this instead?!:
$order->get_user_id()
I don't know how to change my current code.
Is someone able to modify my current code please?