How to Change Invoice Number in WooCommerce

It is possible that you might want to change or reset the invoice number due to several reasons and it is difficult to change invoice number once it’s been set in WooCommerce. But using WebToffee’s PDF Invoice and Packing Slip plugin for WooCommerce it becomes the easiest task ever.

Checkout our short tutorial given below to know how the invoice number can be changed.

You can get started by installing and activating the plugin. From the WordPress dashboard, navigate to the Invoice/Packing > Invoice. You can set up a custom invoice number with prefix/suffix/number series or even mirror the order number as invoice number respectively.

WooCommerce Invoice or packing-Invoice Settings- Invoice Number
WooCommerce Invoice or packing-Invoice Settings- Invoice Number
  • Invoice number format: Specify the format in which the invoice has to be generated. For example: [prefix][number][suffix]
    Invoice number format
  • Use the order number as invoice number: Choose Yes to use the order number as the invoice number. If you want to generate a custom invoice number then select No and input the necessary details into the populated fields. The fields are populated on the basis of the number format previously selected.
    • Invoice Start Number: Enter the Invoice Start Number.
      Custom invoice number
      Custom invoice number
  • Invoice Number Prefix: Enter the prefix which will be added before the invoice number. You can use any of the date formats or alphanumeric characters in this field as shown in the popup.
    Date formats
    Date formats
  • Invoice Number Suffix: Enter the suffix which will be added after the invoice number. You can use any of the date formats or alphanumeric characters as a suffix as shown in the image above.
  • Invoice Length: Indicates the total length of the invoice number. If the length of the generated invoice number is less than the provided, it will be padded with ‘0’. E.g if you specify 7 as invoice length and your invoice number is 8009, it will be represented as 0008009 in the respective documents.

Update and reset the invoice number format settings by clicking on the Update and Reset button.

Here is a screenshot of the sample invoice.

Sample WooCommerce PDF Invoice
Sample WooCommerce PDF Invoice

 

All-In-One - Generate PDF Invoice, Packing Slip, Labels & Delivery Note.

Used by 7,000+ WooCommerce Stores

#1 in Customer Satisfaction

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

  • Was this article helpful ?
  • YesNo

2 thoughts on “How to Change Invoice Number in WooCommerce

  1. Imran Khan says:

    Hi!

    Is there a way change the filename of the attached pdf Invoice to be the Invoice Number itself? Or at least a way to add the Invoice Number somewhere in the notification email?

    Thanks

    • Mark
      Mark says:

      Hi,

      Make sure that you are using the latest version(4.0.5 or above) of the plugin and copy below code snippet to your active theme’s functions.php
      add_filter('wf_pklist_alter_pdf_file_name','wf_pklist_invoice_numebr_as_pdf_filename',10,3);
      function wf_pklist_invoice_numebr_as_pdf_filename($name,$template_type,$order_ids)
      {
      if($template_type=='invoice' && class_exists('Wf_Woocommerce_Packing_List_Public'))
      {
      if(Wf_Woocommerce_Packing_List_Public::module_exists('invoice'))
      {
      $name_arr=array();
      foreach($order_ids as $order_id)
      {
      $order=( WC()->version < '2.7.0' ) ? new WC_Order($order_id) : new wf_order($order_id);
      $name_arr[]=Wf_Woocommerce_Packing_List_Invoice::generate_invoice_number($order,false); //do not force generate
      }
      $name=implode('-',$name_arr);
      }
      }
      return $name;
      }

Leave a Reply

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