63
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!
/** * @snippet Add "Note to Customer" @ WooCommerce PDF Invoice * @how-to Get tutoraspire.com FREE * @sourcecode https://tutoraspire.com/?p=21728 * @author Tutor Aspire, Hans Schuijff @ dewitteprins.nl * @compatible WC 3.1.0, Woo P.I.P.S. 2.0+ * @donate $9 https://tutoraspire.com */ add_action( 'wpo_wcpdf_after_order_details', 'tutoraspire_add_note_to_customer_to_PDF_invoice_new', 10, 2 ); function tutoraspire_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: