How to Change WooCommerce new order email?

admin2025-06-05  2

I'm new to WooCommerce and I have had a request to make a minor change to the new order email which I have managed to find the template, but I am not sure which line I should change.

At the moment the new order email has:

You have received an order from (billing address first name)

But I want to change it to:

You have received an order from (username which made the order)

Is this possible? Would this just change the variable the email is using?

Thanks in advance.

I'm new to WooCommerce and I have had a request to make a minor change to the new order email which I have managed to find the template, but I am not sure which line I should change.

At the moment the new order email has:

You have received an order from (billing address first name)

But I want to change it to:

You have received an order from (username which made the order)

Is this possible? Would this just change the variable the email is using?

Thanks in advance.

Share Improve this question edited Jan 7, 2018 at 1:05 Ciprian 8792 gold badges11 silver badges27 bronze badges asked Jan 6, 2018 at 11:21 WoohelpWoohelp 311 silver badge3 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

I have found the line I need to edit I think

<p><?php printf( __( 'You have received an order from %s. The order is as follows:', 'woocommerce' ), $order->get_formatted_billing_full_name() ); ?></p>

would that change to

<p><?php printf( __( 'You have received an order from %s. The order is as follows:', 'woocommerce' ), $order->get_user() ); ?></p>

Yes, it's possible.

Copy the email folder from the plugin directory to a woocommerce folder in your child-theme.

/wp-content/plugins/woocommerce/template/emails/admin-new-order.php

gets copied to

/wp-content/themes/your-theme/woocommerce/emails/admin-new-order.php

Then you can change the email template to suit your needs.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749078979a316179.html

最新回复(0)