I use the “WooCommerce PDF Invoices & Packing Slips” plugin, available on the WP Repository, to invoice my clients. At times, for accounting purposes, I need to show the VAT/TAX ID of the client on the PDF invoice.

So, I open the order via WooCommerce > Orders, open the order I want to edit, add a “Note to the Customer” from the right hand side… and then have the following snippet in my functions.php adding such information on the PDF invoice!

Add a “Note to customer” via the Order Admin

/**
 * @snippet       Add "Note to Customer" @ WooCommerce PDF Invoice
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=21728
 * @author        Rodolfo Melogli, Hans Schuijff @ dewitteprins.nl
 * @compatible    WC 3.1.0, Woo P.I.P.S. 2.0+
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_action( 'wpo_wcpdf_after_order_details', 'bbloomer_add_note_to_customer_to_PDF_invoice_new', 10, 2 );

function bbloomer_add_note_to_customer_to_PDF_invoice_new( $template_type, $order ) {
    $document = wcpdf_get_document( $template_type, $order );
    $document->order_notes();
}

And here’s the final result:

Displaying order notes on “WooCommerce PDF Invoices & Packing Slips” invoice PDF
Share:

Leave a Reply