Documentation/Print Invoice, Packing Slip, Delivery Note & Label for WooCommerce/How to customize the filename of PDF Invoice/Proforma Invoice

How to customize the filename of PDF Invoice/Proforma Invoice

One of the most sought after feature of the Print Invoice and Packing Slip plugin is its ability to attach the PDF invoice in the WooCommerce Order email.

You may also need to have a customized filename for the PDF invoice with custom text appended with the order number or even want the invoice number as the PDF filename. Following are some of the code snippets by which you can customise the filename of PDF invoice/proforma invoice.

Custom filename for invoices/proforma invoice

To assign a custom text content for the PDF invoice, insert the below given code snippet in the active theme’s functions.php file.

As per the above code snippet, the file name will be changed from invoice_1234 to facture_1234 for single order and for bulk orders, the name will be changed from invoice_bulk_1000-1001-1003 to facture_bulk_1000-1001-1003. However, you can replace the text facture with the customized texts of your choice to obtain the PDF invoice with that filename.

Now if you want to have a customized filename for both invoice and proforma invoice then, insert the below given code snippet in the active theme’s functions.php file.

As mentioned earlier, you can replace facture with the text of your choice to get the invoice/ proforma invoice with that filename.

Invoice Number as PDF invoice filename

To set the invoice number as the PDF invoice filename, simply insert the below given code snippet in the active theme’s functions.php file.

Custom proforma invoice number as proforma PDF name

To set custom proforma invoice number as proforma PDF name, insert the below given code snippet in the active theme’s functions.php file.

  • Was this article helpful?
  • YesNo