• Resolved pandglobal

    (@pandglobal)


    Please i want to add first name and last name to email body in customer-completed-order.php which is among the email templete. however i want to add something like Hello firstname
    PLEASE HOW CAN I DO THIS? I WANT TO ADD IT IN THE EMAIL TEMPLATE FILE

    <p><?php printf( __( “Hi {FIRSTNAME}. Your recent order on %s has been completed. Your order details are shown below for your reference:”, ‘woocommerce’ ), get_option( ‘blogname’ ) ); ?></p>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hello there,

    WooCommerce has no built in feature for this.

    You can try: $order->billing_first_name instead.

    "Hi" . $order->billing_first_name . "Your recent order on"

    Alternatively have a look at: https://www.ads-software.com/support/topic/how-to-add-customer-name-to-new-customer-admin-order-email/

    Kind regards,

    Thread Starter pandglobal

    (@pandglobal)

    PLEASE I HAVE TRIED THE CODE BUT IT DIDN’T WORK AND MOST TIMES IT SAYS INTERNAL ERROR DURING CHECKOUT AND YET THE USER NAME IS NOT BEING SENT

    Thread Starter pandglobal

    (@pandglobal)

    this is the full code i used
    /**
    * @hooked WC_Emails::email_header() Output the email header
    */
    do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>

    <p><?php printf( __( “Dear, Thank you! %1$s”, ‘woocommerce’ ), $order->billing_first_name ); ?></p>

    <p><?php _e( “Your order is on-hold until we confirm payment has been received. Your order details are shown below for your reference:”, ‘woocommerce’ ); ?></p>

    <?php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HOW TO ADD USER FIRST NAME AND USER NAME TO EMAIL BODY’ is closed to new replies.