By default, all the templates will be shown on the orders page, if you have more than one they are displayed in a dropdown
But you can configure the templates to be shown only when a condition is met, for example, you could configure a template to be included only when a specific product is purchased or when a user with a specific role is viewing it.
To hide a template do the following:
1.- Go to template settings, and open the ‘Conditions’ tab
2.- Create your condition, in the example below the template is only generated when the order has a product whose product SKU contains the text ‘PRO’
That’s it! Now your template will only be included when your configured condition is met.
Sometimes you want to add elements in your template but you not always want to show them, to hide elements of the template when a condition is met (such like the order was refunded or it has an specific product) do the following:
1.- Select the field in the template designer and click on conditions
2.- Configure the condition that you want to use, in the example bellow the field will be hidden if the order has a product with the name “My Product”
That’s it now the product will be hidden when the condition is met.
By default all the pdf templates that you created will be shown in the orders table of woocommerce:
This is generally perfect but, things could get tricky when you create conditional templates, by default all the templates are going to be shown even if the condition that you configure doesn’t match the current order
To hide the conditional templates when the order doesn’t match its configured condition do the following:
1.- Go to template settings:
2.- Click in “Condition”
3.- Check don’t show this template in the orders page if the order doesn’t met this condition
That’s it! now the template will only be shown in orders that match the configured condition.
If you want to send an specific type of invoice only when a condition is met (for example an specific product or product category was purchased). Please do the following:
1.- Open ‘Template Settings’
2.- Go to the Condition tab
3.- Define your condition
That’s it! Now your invoice is only going to be created when the condition is met!