Skip to content

Instantly share code, notes, and snippets.

@trangsihung
Created November 2, 2017 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trangsihung/551046fe5d29a4cc411cc55e0478b6ea to your computer and use it in GitHub Desktop.
Save trangsihung/551046fe5d29a4cc411cc55e0478b6ea to your computer and use it in GitHub Desktop.
// class-wc-emails.php:443
public function customer_details( $order, $sent_to_admin = false, $plain_text = false ) {
// if ( ! is_a( $order, 'WC_Order' ) ) {
// return;
// }
$fields = array();
if ( $order->customer_note ) {
$fields['customer_note'] = array(
'label' => __( 'Note', 'woocommerce' ),
'value' => wptexturize( $order->customer_note )
);
}
if ( $order->billing_email ) {
$fields['billing_email'] = array(
'label' => __( 'Email', 'woocommerce' ),
'value' => wptexturize( $order->billing_email )
);
}
if ( $order->billing_phone ) {
$fields['billing_phone'] = array(
'label' => __( 'Tel', 'woocommerce' ),
'value' => wptexturize( $order->billing_phone )
);
}
$fields = array_filter( apply_filters( 'woocommerce_email_customer_details_fields', $fields, $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 ) );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment