Documentation

Conditional issuing of invoices

You can set up conditions for issuing invoices with selected templates using the Flexible Invoices Conditional Templates add-on.

The Flexible Invoices Conditional Templates add-on allows you to automatically select an invoice template based on order conditions such as buyer country, currency, order value, payment method, product, product category, user role, or VAT number.

Installation#

  1. Prerequisites: Flexible Invoices for WooCommerce, version 5.1 or higher.
  2. Download: Get flexible-invoices-conditional-templates.zip from your flexibleinvoices.com/my-account/.
  3. Install:
    • In WordPress Admin, go to Plugins → Add New → Upload Plugin.
    • Select the ZIP file and click Install Now, then Activate.
  4. Verify: Go to Invoices → Settings → Conditional logic for templates and check if the new settings tab is available.

Settings Overview#

Conditional logic for invoice templates settings

Go to Invoices → Settings → Conditional logic for templates. In this section, you can define rules that decide which invoice template should be used when the selected conditions are met.

If none of the rules match the order, the default active invoice template will be used.

Rule Interface#

  • New group - adds a new conditional rule group.
  • Issue with a template - allows you to issue an invoice with a selected template when the conditions are met.
  • Do not invoice - prevents automatic invoice issuing when the conditions are met.
  • Template - allows you to select one of the published invoice templates.
  • Add condition - adds another condition inside the same condition group.
  • Add condition group - adds an alternative condition group.
  • Save changes - saves the conditional logic settings.

How conditions work#

  • Conditions inside one condition group are combined with AND logic. This means that all conditions in the group must be met.
  • Additional condition groups work as alternatives and are combined with OR logic.
  • Rules are checked from top to bottom. If more than one rule matches the order, the last matching rule will be used.

Available Conditions#

Condition Type Description
Buyer country Checks the customer's billing country. Available operators: Is, Is not.
Currency Checks the order currency. Available operators: Is, Is not.
Order value Checks the gross order total. Available operators: greater than, less than, equal.
Payment method Checks the WooCommerce payment method used in the order. Available operators: Is, Is not.
Product Checks whether the order contains a selected product. Available operators: Is, Is not.
Product category Checks whether order items belong to a selected product category. For variation products, the category of the parent product is checked. Available operators: Is, Is not.
User role Checks the WordPress role of the customer assigned to the order. Available operators: Is, Is not.
VAT Number Checks the customer's VAT number. Available operators: equal, empty, filled.

Save changes to apply your rules.

You can add as many rule groups as needed to customize the invoicing process in your WooCommerce store.

Usage Examples#

The following examples illustrate common conditional template configurations.

Example 1: Germany Orders#

Goal: Use a special invoice template for orders with Germany as the buyer country.

Conditional logic by buyer country

  1. Select Issue with a template.
  2. Select the invoice template you want to use for German orders.
  3. Add condition: Buyer country is Germany.
  4. Save changes.

Result: Orders with Germany as the buyer country will use the selected invoice template.

Example 2: Specific Product#

Goal: Apply a custom invoice template when the order contains a selected product.

Conditional logic by product

  1. Select Issue with a template.
  2. Select the invoice template you want to use for this product.
  3. Add condition: Product is [selected product].
  4. Save changes.

Result: Orders containing the selected product will use the selected invoice template.

Example 3: B2B Customers#

Goal: Use a B2B invoice template when a VAT Number is provided.

Conditional logic by VAT Number

  1. Select Issue with a template.
  2. Select the invoice template you want to use for B2B customers.
  3. Add condition: VAT Number filled.
  4. Save changes.

Result: Orders with a VAT Number will use the selected B2B invoice template.

Document Template metabox#

The add-on also adds a Document template metabox to the document edit screen. It shows the currently selected template for document generation. You can use conditional logic to dynamically assign templates for documents created from WooCommerce orders.

Not the solution you are looking for?

Please check other articles or open a support ticket.