Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › username in order completion email
- This topic has 15 replies, 2 voices, and was last updated 4 years, 8 months ago by Diana.
-
AuthorPosts
-
March 9, 2020 at 8:22 pm #245113MeesterGijsSpectatorThanks! I misinterpreted zip for rar. So that issue is fixed. Great! Dear friends, Perhaps I should ask this Woocommerce, but I thought this would be quicker solved.. I can't seem to get the username in order completed email. So this is my template. I put it at /domains/meestergijs.nl/public_html/wp-content/themes/metmeestergijs/woocommerce/emails This is the string that does gets translated from Hi to Hallo (Dutch Hi), but the code for username (%s) doesn't show the username in the email. See email. So what am I missing? GijsMarch 11, 2020 at 2:14 pm #245274DianaParticipant@MeesterGijs, The Billing First Name was present on the checkout page? or not?(which is in the code) I think the value was null due to which nothing passed in the email as wellMarch 11, 2020 at 6:16 pm #245304MeesterGijsSpectatorYou are correct. But even when chaing the template string from: <?php /* translators: %s: Customer first name */ ?> <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p> <?php /* translators: %s: Site title */ ?> to <?php /* translators: %s: Customer first name */ ?> <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_field_4097() ) ); ?></p> <?php /* translators: %s: Site title */ ?> it still doens't work. Field 4097 because: this is first name in registration form. What am I missing?March 12, 2020 at 8:18 pm #245488DianaParticipant@MeesterGijs, Try adding this and check the Woocommerce header if it is fetching the billing name or not. Try adding this code in wp-admin > Plugins > Editor > Select WPLMS Customizer Plugin > wplms-customizer.php add_action( 'woocommerce_email_order_details', 'ts_email_order_details', 10, 4 ); function ts_email_order_details( $order, $sent_to_admin, $plain_text, $email ) { echo ' Hey '.$order->get_billing_first_name().', We hope you had fun shopping with us.'; }March 12, 2020 at 8:27 pm #245489MeesterGijsSpectatorUnfortunatelly it didn't. Checked it immediately :) It just says: Hey , We hope you... No name/username after Hey The firstname or username are filled in at meestergijs.nl/aanmelden. Maybe you can check that page and see the field numbers (username and voornaam) and how that affects the code.. ThanksMarch 13, 2020 at 11:25 am #245563DianaParticipantThis reply has been marked as private.March 13, 2020 at 1:09 pm #245586MeesterGijsSpectatorThis reply has been marked as private.March 14, 2020 at 7:04 pm #245713DianaParticipantThis reply has been marked as private.March 14, 2020 at 7:22 pm #245714MeesterGijsSpectatorGreat that you ask. How can I allow payments/checkout without being logged in? Also, I don't want extra billing details. I don't need addresses and stuff like that. How can I still send the activation emails?March 16, 2020 at 1:28 pm #245896DianaParticipant@MeesterGijs, Then it is not possible to send username in order completion email. Because WordPress can't fetch the Billing details thenMarch 18, 2020 at 7:43 pm #246249MeesterGijsSpectatorThank you, very clear. So I can't allow payments/checkout without adding billing details? Could just one field be enough? Any tips?March 19, 2020 at 6:02 am #246292DianaParticipant@MeesterGijs, Yes, If you want the field information to appear in the email then it is necessary to add the field in the checkout detailsMarch 19, 2020 at 6:24 am #246299MeesterGijsSpectatorThat's not what I mean. My question was: how can I let people buy an item without having to be logged in. Because I have one new product that doesn't require an account. And it's a digital downloadable product.March 19, 2020 at 6:34 pm #246417DianaParticipant@meesterrgijs, You have to check the handing of these category of product in woocommerce: https://docs.woocommerce.com/document/digital-downloadable-product-handling/March 25, 2020 at 8:34 pm #247328MeesterGijsSpectatorThanks, Diana! closing
-
AuthorPosts
- The topic ‘username in order completion email’ is closed to new replies.