• Resolved Aitutakiraro

    (@jeannettepeter6)


    Hi,
    I have solved the mentioned problem until last update. But the php text is now different. Can you please help me how the new text should say if I want to add the last name AFTER the first name in the WooCommerce emails (Hi %s)? It does no longer work since today. I would be very happy if you could correct my text so that it works again. Many thanks! The php-files are in woocommerce/templates/emails/plain

    Original:
    /* translators: %s: Customer first name */
    echo sprintf( esc_html__( ‘Hi %s,’, ‘woocommerce’ ), esc_html( $order->get_billing_first_name() ) ) . “\n\n”;

    What does no longer work – where is the fault – how should the text be exactly?:
    /* translators: %s: Customer first name */
    echo sprintf( esc_html__( ‘Hi %s,’, ‘woocommerce’ ), esc_html( $order->get_billing_first_name() . ‘ ‘ . $order->get_billing_last_name() ) ) . “\n\n”;

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @jeannettepeter6

    Please try replacing get_billing_first_name() with get_formatted_billing_full_name().
    This should output the full name instead of the first name only.

    Note: to override and edit email templates, it’s advised to copy the files to your theme’s folder (or to your child theme’s folder).
    You can do that by following this general structure:
    Original file: woocommerce/templates/emails/[file-name.php]
    Custom file: [theme-folder]/woocommerce/emails/[file-name.php]

    More information about e-mail customization here:
    https://woocommerce.com/posts/how-to-customize-emails-in-woocommerce/

    Hope that helps!

    We’ve not heard back from you, so I’m marking this thread as resolved. Hopefully, the above info was helpful.

    If you have any other questions, please feel free to open a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Woocommerce Emails add Last name’ is closed to new replies.