WooCommerce New Order Email template doesn’t change


I have an update to my admin-new-order.php integrated via functions.php and everything works well on one website. But when I paste this code to my second website nothing happens with emails. I deactivated all plugins and set the default theme but I still can’t see the changes. The code is:

function add_custom_text_to_new_order_email( $order, $sent_to_admin, $plain_text, $email ) {
    // Only for "New Order" email notifications (to be replaced by yours)
    if( ! ( 'new_order' == $email->id ) ) return;

    // Display a needed text
    echo '<p>'.__('Custom Text').$order->get_billing_email().'</p>';

Does anyone know what is wrong here?

Jamdev 4 months 0 Answers 10 views 0

Leave an answer