• Resolved massidrink1976

    (@massidrink1976)


    Hello,
    if a customer places an order through WooCommerce, he receives an email notification that starts like this: “Hi Luigi, thanks for your order”. I would also like to add the customer’s Surname to the Name.
    I have already seen that the template to be modified is located on the graphic theme folder in: woocommerce/emails/customer-on-hold-order.php

    But how can we also add the surname?

    Thank you in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The order object and its methods are described here:
    https://docs.woocommerce.com/wc-apidocs/class-WC_Order.html

    You’re looking for: order->get_billing_last_name();

    Thread Starter massidrink1976

    (@massidrink1976)

    I must to add this part
    order->get_billing_last_name();

    only in this file?
    woocommerce/emails/customer-on-hold-order.php

    Yes, so line 26 becomes:
    <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() .' '.$order->get_billing_last_name() ) ); ?></p>
    Sorry, not tested.

    Don’t forget to put your custom template at:
    wp-content/themes/your-child-theme-name/woocommerce/emails/customer-on-hold-order.php so that is not overwritten by updates.

    I assume you are not sending text emails. If so, that’s a separate task.

    Thread Starter massidrink1976

    (@massidrink1976)

    Thank you, Iorro.
    I changed the line and now works fine!

    Thread Starter massidrink1976

    (@massidrink1976)

    Another question, if is possible.
    In the email “Customer On Hold Order”, is possible to move “Bank account details” as last information before the footer?

    Yes in the sense that almost anything can be done, but that’s more tricky than the last-name request. PHP skills or a developer will be needed. Its unlikely that someone would provide the code in a forum answer.

    Please note that WooCommerce do update the email templates from time-to-time, not every point update for sure, but sometimes they do. When this happens any customised email templates will need to be reviewed to ensure they remain compatible. So customised templates create an on-going burden and perhaps cost for the webmaster.

    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    This thread has been inactive for a bit, so I’m going to mark it as Resolved now. Please feel free to open a new one if you have any further questions.

    Cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Email for Customers Woocommerce’ is closed to new replies.