Mitteilungen von Kunden bei WooCommerce Bestellungen lassen sich leider nur sehr mühsam im Backend lesen. Das folgende Code Snippet druckt Kunden-Mitteilungen auf den Bestellungen von WooCommerce an:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
add_action( 'woocommerce_email_after_order_table', 'customer_note_email_after_order_table', 10, 4 ); function customer_note_email_after_order_table( $order, $sent_to_admin, $plain_text, $email ){ // Only on some email notifications if ( in_array( $email->id, array('new_order', 'customer_on_hold_order', 'customer_processing_order', 'customer_completed_order') ) ) : // Get customer Order note $customer_note = $order->get_customer_note(); // Display the Customer order notes section echo '<h2>' . __("Order notes", "woocommerce") . '</h2> <div style="margin-bottom: 40px;"> <table cellspacing="0" cellpadding="0" style="width: 100%; color: #636363; border: 2px solid #e5e5e5;" border="0"> <tr><td><p>' . $customer_note . '</p></td></tr> </table></div>'; endif; } |
WooCommerce Bestellmails sehen dann so aus: