WooCommerce: Add Order Notes to WooCommerce PDF Invoices

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+
 * @community     https://businessbloomer.com/club/
 */

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

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Get Order Info (total, items, etc) From $order Object
    As a WooCommerce development freelancer, every day I repeat many coding operations that make me waste time. One of them is: “How to get ____ if I have the $order variable/object?“. For example, “How can I get the order total“? Or “How can I get the order items“? Or maybe the order dates, customer ID, […]
  • WooCommerce: How to Add a Custom Checkout Field
    Let’s imagine you want to add a custom checkout field (and not an additional billing or shipping field) on the WooCommerce Checkout page. For example, it might be a customer licence number – this has got nothing to do with billing and nothing to do with shipping. Ideally, this custom field could show above the […]
  • WooCommerce: Create a Custom Order Status
    All WooCommerce orders go to either “processing”, “completed”, “on-hold” and other default order statuses based on the payment method and product type. Sometimes these statuses are not enough. For example, you might need to mark certain orders in a different way for tracking, filtering, exporting purposes. Or you might want to disable default emails by […]
  • WooCommerce: Allow Users to Edit Processing Orders
    How can WooCommerce customers edit an order they just placed and paid for? I swear I looked on search engine results and other places before coming to the conclusion I needed to code this myself. For example, a user might want to change the delivery date (if you provide this on the checkout page). Or […]
  • WooCommerce: Add Column to Orders Table @ WP Dashboard
    The WooCommerce Orders Table, which can be found under WP Dashboard > WooCommerce > Orders, provides us with 7 default columns: Order – Date – Status – Billing – Ship to – Total – Actions. This is used by shop managers to have an overview of all orders, before eventually clicking on a specific one. […]

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

16 thoughts on “WooCommerce: Add Order Notes to WooCommerce PDF Invoices

  1. I’ve been trying to find this solution, but for the invoices and packing slip plugin that webtoffee makes. And it’s driving me up a wall. Why on earth did woocommerce decide to use post comments as the order notes instead of using postmeta???

    Any ideas on how I can get it to work on the plugin I’m using? Hopefully you’ve used it before.

    1. I’m sure WebToffee will be happy to help

  2. Hello its not working now can you check ?

    1. Works for me. Which PDF plugin are you using?

      1. Hello
        Thanks a lot for all your tips – very useful !
        This one does not work for me either – I use Woocommerce Pdf Invoices Packing Slips.
        Could you please double-check if one of the latest Woocommerce updates have not impactd your snippet ?

        Thanks

        Nick

        1. Hi Nick, seems https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-order-notes/ states the same. In case contact the plugin dev?

  3. Thanks as always. I am having difficulty understanding if each of the two snippets goes into the child theme functions.php? When I added both nothing seemed to appear in the pdf invoice. Thanks.

    1. Hey Adam, thanks for your comment! I removed the second snippet as it’s obsolete now, so you need to use just the first one. Order notes should appear on PDF invoices, unless something has changed in the plugin coding. Please note only “Notes to customer” will show (and not the other kind of notes). Test this out and let me know ๐Ÿ™‚

  4. Thanks for sharing your WP code snippets, very useful.

    1. You’re welcome!

  5. thanks for that snippet, works fine. Only thing is: it shows “Note to client” on the Invoice as well, followed by the actual note.

    Is there an easy way to get rid of the “Note to client” part?

    1. Hello Chris, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  6. I want to do something similar with this plugin but do not know how to write the code!

    I want to add the customer’s email to the packing list right underneath the shipping method. I cannot figure out how to do it for the life of me.

    1. Hey Linda, thanks for your comment! Have you tried asking the plugin’s support team?

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *