$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>How to Change WooCommerce new order email?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

How to Change WooCommerce new order email?

matteradmin8PV0评论

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.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far