1

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.

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>
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.