Home > Docs > WooCommerce Proforma Invoices Plugin > Adding Custom Filename to WooCommerce Proforma Invoices

Adding Custom Filename to WooCommerce Proforma Invoices

Last updated on December 7, 2023

The WebToffee’s WooCommerce Proforma Invoices plugin allows store owners to add custom filenames to WooCommerce proforma invoices. The plugin allows the store owners to select a desired filename format and add a custom prefix to it. Store owners can do this by following the below steps:

  1. Choosing a filename format for the Proforma invoice PDF documents.
  2. Adding a custom prefix to the filename. Store owners can add a custom prefix in two ways:
    1. Using the Custom PDF name prefix option.
    2. Using a custom code snippet.

Choosing filename format for proforma invoice PDF documents

Store owners can choose from the two filename formats given by the plugin. It can either be [prefix][order_no] or [prefix][proforma_invoice_no]. Follow the below steps to choose a filename format for Proforma invoice PDF documents:

  1. Navigate to Invoice/Packing > Proforma invoice > General.
  2. Under the General tab, head to the Others section.
  3. Navigate to the PDF name format option and choose the preferred PDF filename format from the dropdown menu. For example, let’s select it as [prefix][proforma_invoice_no].
Selecting a PDF filename format
Selecting a PDF filename format
  1. Click on Update Settings and save changes.

Adding a custom prefix to the filename

1. Using the Custom PDF name prefix option

The plugin provides store owners with the provision to add a custom prefix of their choice to the filename. The custom prefix will appear along with the order number or the proforma invoice number in the filename. To add a custom prefix to the filename follow these steps:

  1. From the Others section, navigate to the Custom PDF name prefix optionand input a custom prefix in the space provided. (By default the custom prefix for the filename will be Proformainvoice_). Here let’s take an example of adding a custom prefix ‘Estimate’.
Adding a custom PDF name prefix
Adding a custom PDF name prefix
  1. Click on Update Settings and save changes.

Use case

The Admin generates the Proforma invoice PDF document for order #2990 with the proforma invoice number 2990. The Proforma invoice PDF document with the filename ‘Estimate2990’ is downloaded as shown below.

Proforma invoice with custom filename is downloaded
Proforma invoice with custom filename is downloaded

2. Using a custom code snippet

Store owners can add custom prefixes to proforma invoice PDF documents using the custom code snippet given below. This snippet is applicable to both single orders and bulk orders. To add a custom prefix using the custom code snippet, follow the below steps:

  1. To add a custom prefix for single orders, replace ‘proformaprefix’ in the custom code snippetwith the prefix name of your choice. For bulk orders, replace ‘proformaprefixbulk’ with the prefix name of your preference.
  2. Add the custom code snippet to the WordPress site which is currently in use. Add it to the active child themes functions.php file or use a third-party plugin for the addition. To know more about how to add a custom code snippet using a third-party plugin, refer to this article.