Username field in the order confirmation email
-
Hello!
I need to add the “username” field in the order confirmation email.I added this code in the file “admin-new-order”:
do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>
<?php /* translators: %s: Customer billing full name */ ?>
<?php $user_info = get_userdata(1);
echo ‘Kundennummer: ‘ . $user_info->ID . “\n”;
?>but something is wrong.
In the confirmation email, “1” appears instead of my username “132064”
I tried also another version:
do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>
<?php /* translators: %s: Customer billing full name */ ?>
<?php $user_info = get_userdata(1);
echo ‘Username: ‘ . $user_info->user_login . “\n”;?>
but in this case, appear “admin” and also is wrong.
How can I fix?
Regards,
Massimiliano
- The topic ‘Username field in the order confirmation email’ is closed to new replies.