WC_Emails::customer_details( WC_Order $order, bool $sent_to_admin = false, bool $plain_text = false )

Allows developers to add additional customer details to templates.


Description Description

In versions prior to 3.2 this was used for notes, phone and email but this data has moved.


Parameters Parameters

$order

(Required) Order instance.

$sent_to_admin

(Optional) If should sent to admin.

Default value: false

$plain_text

(Optional) If is plain text email.

Default value: false


Top ↑

Source Source

File: includes/class-wc-emails.php

	public function customer_details( $order, $sent_to_admin = false, $plain_text = false ) {
		if ( ! is_a( $order, 'WC_Order' ) ) {
			return;
		}

		$fields = array_filter( apply_filters( 'woocommerce_email_customer_details_fields', array(), $sent_to_admin, $order ), array( $this, 'customer_detail_field_is_valid' ) );

		if ( ! empty( $fields ) ) {
			if ( $plain_text ) {
				wc_get_template( 'emails/plain/email-customer-details.php', array( 'fields' => $fields ) );
			} else {
				wc_get_template( 'emails/email-customer-details.php', array( 'fields' => $fields ) );
			}
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.