Start a project

PDF Invoice Filter Hooks

The following filters are available to modify data used in the invoice PDF:

woocommerce_pdf_invoices_meta_data
woocommerce_pdf_invoices_order_data
woocommerce_pdf_invoices_order_items
woocommerce_order_item_permalink
woocommerce_order_item_name
woocommerce_order_item_quantity_html

Questions & answers (47)

  1. IleDecember 8, 2024

    Hi,

    how to put barcode which need to show ORDER Number , i try to follow links / desctiption in documenttion but nothing
    please for advise

    thanks in advance

  2. LouApril 26, 2025

    Find a solution yet?

  3. yogesh soniSeptember 16, 2024

    add_filter(‘woocommerce_pdf_invoices_meta_data’, ‘add_billing_gstnumber_to_pdf_invoice’, 10, 2);

    function add_billing_gstnumber_to_pdf_invoice($meta_data, $order) {
    // Get the billing GST number from the order
    $billing_gstnumber = get_post_meta($order->get_id(), ‘billing_gstnumber’, true);

    // Add GST number to the meta data array
    if (!empty($billing_gstnumber)) {
    $meta_data[‘Billing GST Number’] = $billing_gstnumber;
    }

    return $meta_data;
    }
    using this function to fetch data but not able to do

  4. yogesh soniSeptember 16, 2024

    {{add_billing_gstnumber_to_pdf_invoice}}
    add_custom_meta_to_pdf_invoice
    {{_billing_gstnumber}}
    {{meta__billing_gstnumber}}
    {{Meta_billing_gstnumber}}

    tried all but not able to fetch data

  5. DanielSeptember 16, 2024

    Please submit a ticket on our website or send your request including your valid codecanyon purchase code to [email protected]

  6. yogesh soniSeptember 16, 2024

    i have a custom meta field billing_gst number but after using your filter i am not able to get that data into my invoices

  7. yogesh soniSeptember 16, 2024

    add_filter(‘woocommerce_pdf_invoices_meta_data’, ‘add_billing_gstnumber_to_pdf_invoice’, 10, 2);

    function add_billing_gstnumber_to_pdf_invoice($meta_data, $order) {
    // Get the billing GST number from the order
    $billing_gstnumber = get_post_meta($order->get_id(), ‘billing_gstnumber’, true);

    // Add GST number to the meta data array
    if (!empty($billing_gstnumber)) {
    $meta_data[‘Billing GST Number’] = $billing_gstnumber;
    }

    return $meta_data;
    }
    using this function to fetch data but not able to do

  8. AurimasAugust 24, 2024

    Is there a way to display note on invoice if buyer is from certain country? I mean if buyer is, let’s say from outside of European Union, i want to display additional note on the invoice about VAT calculation. There should be something like simple “If()” statement where I can filter checkout fields information or something similar.

  9. DanielAugust 24, 2024

    That is not possible by default, but you can add an own variable using our woocommerce_pdf_invoices_order_data filter. Then just get the order and check if the user is outside the EU and add the variable.

  10. RoshJanuary 23, 2024

    Customers are using a coupon code to purchase items. How do I display the coupon codes on the packing slip under the invoice number.

  11. NINAFebruary 17, 2023

    Hello, I use Woo Commerce Market Place so I would like to know if it will be possible to generate Invoices only for “seleceted” vendors not all vendors

  12. DanielFebruary 17, 2023

    Well currently not, but we can customize / add this feature for you on Charge. Contact us at [email protected]

  13. KurhanDecember 5, 2021

    how can i add the created invoices to automatewoo add raw html email?

  14. DanielDecember 6, 2021

    Sorry we do not know – maybe you ask automatewoo support. Our invoice PDFs are saved in wp-content/uploads/pdf-invocies folder.

  15. ImranNovember 25, 2021

    Is there a way to add a shortcode for the PDF download on the Thank you page?
    I use woofunnels.

  16. DanielNovember 25, 2021

    A link on the thank you page is added automatically when you have enabled to show the invoice to customers.

  17. MicheleSeptember 18, 2021

    Hi, it seems that “{{customer_note}}” shortcode in pdf invoices settings-content doesn’t work. If I add in the order editor a note set as “note to customer”, in the pdf invoice it doesn’t appear (obviously even if I click on “Update Invoice” button).

  18. DanielSeptember 19, 2021

    The customer_note field is used only for the comments a customer can do during checkout.

  19. malamal.xyzltdAugust 28, 2021

    Is there any option to add date in the invoice? The plugin I am using has no option to date the invoice, so what are the date options? if there date option then i will buy this plugin

  20. DanielAugust 28, 2021

    Yea you can use the order created date or put in any custom date if you want.

  21. DimitriAugust 5, 2021

    What if I added a custom field to my WooCommerce Checkout (i.e. VAT Number), can I add that to the invoice?

  22. DanielAugust 28, 2021

    Yea our plugin supports ALL custom invoice fields.

  23. DanielJuly 21, 2021

    Yes correct. The setup is 90% the same.

  24. ScottJuly 21, 2021

    Is it possible to remove billing and shipping addresses, while retaining or adding billing first and last names, plus a custom field from order meta?

  25. DanielJuly 21, 2021

    Yes sure all invoice fields are fully customizable.

  26. ScottJuly 21, 2021

    Thanks. Your documentation shows settings for invoices only. I don’t need invoices. I do need packing slips. Possible to configure for packing slips only?

  27. DanielJuly 21, 2021

    Yes, because they are 2 separate woocommerce Plugins.

  28. ScottJuly 21, 2021

    So if I buy the plugin “WooCommerce PDF Invoices & Packing Slips” from your site, I actually get two separate plugins? Then where is the documentation that shows how the packing slip plugin works?

  29. SvetaMarch 21, 2021

    Hi, I have one site with the PDF invoice. I’d like to install it also on the second one, but I’d like to merge numbering of the invoices on both sites – site 1: invoice #1, site 2: invoice #2, site 1: invoice #3 and so on (depending on the sales on each of the sites). Is it possible to combine the two somehow?

  30. DanielMarch 21, 2021

    Well currently not, but we can customize / add this feature for you on Charge. Contact us at [email protected]

  31. PeterMarch 10, 2021

    Is there a code example on how this used? I have a custom field associated with an order being generated by a plugin that I want to include in the PDF.

  32. GavinOctober 30, 2020

    Ship to:
    {{shipping_company}}
    {{shipping_first_name}} {{shipping_last_name}}
    {{shipping_address_1}} {{shipping_address_2}}
    {{shipping_postcode}} {{shipping_city}}
    {{shipping_state}} {{shipping_country}}

    how can i add phone and email id here what would be the code

  33. Daniel BarenkampOctober 31, 2020

    Use {{billing_phone}} for phone and {{billing_email}} for email. WooCommerce does not have these data for shipping specific.

  34. aamirkhanMarch 23, 2022

    i want to buy a plugin but before that i want to clear that can we show
    delivery date
    delivery time slot
    each item discounte price

  35. DanielMarch 23, 2022

    Yea that is possible 🙂

  36. AngelMarch 22, 2024

    Hi, how to show “each item discounted price” for the invoice?

  37. AdamOctober 29, 2020

    May i know does packing slip support multi-delivery-addresses?

  38. Daniel BarenkampOctober 29, 2020

    Not tested, but as you can use any data including custom data it should work.

  39. ALVINSeptember 22, 2020

    invoice no can be assigned only when order status changed to completed?

  40. Daniel BarenkampOctober 29, 2020

    Yes!

  41. BalajiSeptember 5, 2020

    Is there a REST API endpoint to get the genrated invoice?

  42. Daniel BarenkampSeptember 5, 2020

    No sorry but pdfs are saved in uploads foldery

  43. Alexandre Laurenti DoneApril 29, 2020

    How can i acess these information

  44. WeLaunchApril 30, 2020

    What do you mean?

  45. Alexandre Laurenti DoneApril 30, 2020

    I mean, I would like to change some info in the table, like, the client wants the tax price after the final price and wants also that theres an empty line before the final price, I would like to know if and how can I change these informations. Thank you!

  46. echoMay 2, 2020

    What if id like to add product thumbnail images need them to show up in invoice?

  47. WeLaunchMay 3, 2020

    That is already a built in functionality by our plugin.