• Muad_Dib

    (@muad_dib)


    Hello,

    I want to build a custom email template for the emails that are sent to customers when an order is placed. I will refer to customer-processing-order.php file. In it, there are two actions that display order details do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); and customer details do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );.

    Digging deeper I see that in email-customer-details.php there is a foreach loops that outputs the contents of this function echo wp_kses_post( $field['value']. In email-addresses.php the address is displayed using this function <?php echo $order->get_formatted_billing_address(); ?>.

    What I would like to do is to build an email template with each field parsed manually. How can I output the content of the functions above on a field by field basis? I want to mix fields in between them do display something like

    Customer Name
    Customer Address
    Customer phone
    Custom checkout fields that I built
    Customer shipping address

    I know that I can hack into those actions with filters but I don’t want to change the order of the fields on every email template, just on a couple of them. Is there a way to display each field from Customer Details and Billing Address manually?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Muad_Dib

    (@muad_dib)

    Doesn’t anyone know to point me in the right direction?

    Hi Muad, have you solved?
    i’ve the same problem.
    Thank

    Thread Starter Muad_Dib

    (@muad_dib)

    Hi ribopg,

    No, I didn’t managed to resolve this issue. I am still searching for a solution. If you find one, please let me know.

    Regards,
    Muad_Dib

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change fileds in email template’ is closed to new replies.