Hi. How can we help?

How to show order notes in the invoice

By default WooCommerce order notes are not showed in the invoice.
If you want include them please add following code to the file functions.php of your theme.
if ( ! function_exists( 'yith_ywpi_show_order_note' ) ) {
function yith_ywpi_show_order_note( $document ) {
$order_id = $document->order->get_id();
$order_notes = wc_get_order_notes( array( 'order_id' => $order_id ) );

if ( ! empty( $order_notes ) ) {
echo '<b>Order note</b><br>';

foreach ( $order_notes as $order_note ) {
echo wp_kses_post( $order_note->content . '<br>' );
}
}
}

add_action( 'yith_ywpi_template_order_content', 'yith_ywpi_show_order_note' );
}
The code take all order notes added to the order manually or automatically by the system .
01.png
 
 
Was this article helpful?
0 out of 2 found this helpful

Back to Help Center >