Before I updated all my plugins and WP I had some information displaying in the new order woo email after the total. Like: customer note, email and phone.
But after the updates they are gone. I do not know from where is this information come from. I tried to look in the woo settings but I did not find anything.
Does someone know how to put them back?
For an example,
// Edit order items table template defaults
function sww_add_wc_order_email_images( $table, $order ) {
ob_start();
$template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
wc_get_template( $template, array(
'order' => $order,
'items' => $order->get_items(),
'show_download_links' => $show_download_links,
'show_sku' => $show_sku,
'show_purchase_note' => $show_purchase_note,
'show_image' => true,
'image_size' => $image_size
) );
return ob_get_clean();
}
add_filter( 'woocommerce_email_order_items_table', 'sww_add_wc_order_email_images', 10, 2 );
For more details,
Link 1 , Link 2 , Link 3 , Link 4
Hope this will helps you.
I finally found a solution, including this code in the function.php
function wc_customer_details( $fields, $sent_to_admin, $order ) {
if ( empty( $fields ) ) {
if ( $order->get_customer_note() ) {
$fields['customer_note'] = array(
'label' => __( 'Customer Note', 'woocommerce' ),
'value' => wptexturize( $order->get_customer_note() ),
);
}
if ( $order->get_billing_email() ) {
$fields['billing_email'] = array(
'label' => __( 'Email address', 'woocommerce' ),
'value' => wptexturize( $order->get_billing_email() ),
);
}
if ( $order->get_billing_phone() ) {
$fields['billing_phone'] = array(
'label' => __( 'Phone', 'woocommerce' ),
'value' => wptexturize( $order->get_billing_phone() ),
);
}
}
return $fields;
}
add_filter( 'woocommerce_email_customer_details_fields', 'wc_customer_details', 10, 3 );
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.