Documentation for the PDF Invoicing for WooCommerce plugin.

Documentation for PDF Invoicing for WooCommerce Plugin

Author: WPFactory PluginsVersion: 2.1.2Updated: 2 months ago
Requires WordPress version: 4.4Tested up to WordPress version: 6.4

Settings

 

PDF Invoicing for WooCommerce plugin lets you add various PDF documents (e.g. invoices, packing slips, credit notes etc.) to WooCommerce.

PDF Invoicing Options

Settings are located in “WooCommerce > Settings > PDF Invoicing”.

General Options

PDF Invoicing for WooCommerce - General Options

Total documents
Sets total number of documents you wish to add. After you save changes, new settings sections will be displayed.
Default: 1

Document Options

PDF Invoicing for WooCommerce - Document Options

Enable/Disable
Enables/disables the current document.
Default: yes
Title
Used in admin, and in “My account > Orders”.
Default: Invoice
Create
Possible values: Manually; On new order; On order status Pending payment; On order status Processing; On order status On hold; On order status Completed; On order status Cancelled; On order status Refunded; On order status Failed.
Default: Manually
Emails
Email attachments. Possible values: New order; Cancelled order; Failed order; Order on-hold; Processing order; Completed order; Refunded order; Customer invoice / Order details; Customer note; Reset password; New account.
Default: None
Number format
You can use shortcodes here. Please note that you can’t use doc_nr prop here.
Default:

INV-[prop name="doc_counter" format="%06d"]
My account
Allow customers to view documents in “My account > Orders”.
Default: no

Page Options

Page orientation
Possible values: Portrait; Landscape.
Default: Portrait
Page format
Sets current document’s page format.
Default: A4 (210 x 297 mm / 8.27 x 11.69 in)
Margin: Top
Default: 27
Margin: Left
Default: 15
Margin: Right
Default: 15

Header Options

Enable header
Enables/disables current document’s header.
Default: yes
Header image
Document’s header image. Needs to be set as path in the uploads folder. You can use shortcodes here.
Default: None
Header title
Document’s header title. You can use shortcodes here.
Default:

Invoice [prop name="doc_nr"]
Header text
Document’s header text. You can use shortcodes here.
Default:

Company name
Company address
Header font size
Default: 7
Enable footer
Enables/disables current document’s footer.
Default: yes
Footer text
You can use shortcodes here. Available placeholders: %page_num%, %total_pages%.
Default: %page_num% / %total_pages%
Footer text alignment
Possible values: Left; Center; Right; Justify.
Default: Right
Footer font size
Default: 7

Content Options

HTML style
Document’s styling. You can use shortcodes here.
Default:

table {
    width: 100%;
}

table th {
    font-weight: bold;
}

table, tr, th, td {
    border: 1px solid gray;
    border-collapse: collapse;
    padding: 2px;
}

table.order-items th.price, table.order-items td.price {
    text-align: right;
}

table.order-items th.qty, table.order-items td.qty {
    text-align: center;
}

table.totals {
    border: none;
}

table.totals th {
    width: 90%;
    text-align: right;
    border: none;
    font-weight: normal;
}

table.totals td {
    width: 10%;
    text-align: right;
    border: none;
    font-weight: bold;
}
HTML content
Document’s content. You can use shortcodes here.
Default:

</pre>
<h1><strong>Invoice</strong></h1>
<p> </p>
<table>
<tbody>
<tr>
<td>Invoice nr.</td>
<td><strong>[prop name=”doc_nr”]</strong></td>
</tr>
<tr>
<td>Invoice date</td>
<td><strong>[prop name=”doc_formatted_date”]</strong></td>
</tr>
<tr>
<td>Order nr.</td>
<td>[prop name=”order_number”]</td>
</tr>
<tr>
<td>Order date</td>
<td>[prop name=”order_formatted_date_created”]</td>
</tr>
</tbody>
</table>
<p>[[clear]]</p>
<table>
<tbody>
<tr>
<th>Seller</th>
<th>Buyer</th>
</tr>
<tr>
<td>Company name<br />
Company address</td>
<td>[prop name=”order_formatted_billing_address”]</td>
</tr>
</tbody>
</table>
<p>[[clear]]</p>
<p>[each_item][/each_item] [if value1="{prop name='order_shipping_total'}" operator="greater" value2="0"][/if]</p>
<table class="order-items">
<tbody>
<tr>
<th style="width: 5%;">Nr.</th>
<th style="width: 56%;">Description</th>
<th style="width: 12%;">SKU</th>
<th class="qty" style="width: 7%;">Qty</th>
<th class="price" style="width: 10%;">Price (excl. tax)</th>
<th class="price" style="width: 10%;">Total (excl. tax)</th>
</tr>
<tr>
<td>[prop name=”item_nr”]</td>
<td>[prop name=”item_name”]</td>
<td>[prop name=”item_product_sku”]</td>
<td class="qty">[prop name=”item_qty”]</td>
<td class="price">[prop name=”item_single” format=”price”]</td>
<td class="price">[prop name=”item_total” format=”price”]</td>
</tr>
<tr>
<td>[prop name=”order_total_items_count” add=”1″]</td>
<td>[prop name=”order_shipping_method”]</td>
<td></td>
<td class="qty">1</td>
<td class="price">[prop name=”order_shipping_total” format=”price”]</td>
<td class="price">[prop name=”order_shipping_total” format=”price”]</td>
</tr>
</tbody>
</table>
<p> </p>
<table class="totals">
<tbody>
<tr>
<th>Total (excl. tax)</th>
<td>[prop name=”order_total_excl_tax” format=”price”]</td>
</tr>
<tr>
<th>Tax</th>
<td>[prop name=”order_total_tax” format=”price”]</td>
</tr>
<tr>
<th>Total (incl. tax)</th>
<td>[prop name=”order_total” format=”price”]</td>
</tr>
</tbody>
</table>
<p> </p>
<p><strong>Total in words:</strong> [prop name=”order_total_in_words”]</p>
<p> </p>
<p><strong>Payment method:</strong> [prop name=”order_payment_method_title”]</p>
<p>[[clear]]</p>
<table style="margin-top: 30px;">
<tbody>
<tr>
<th>Invoice created by:</th>
<td>[prop name=”doc_author_full_name”]</td>
</tr>
<tr>
<th>Invoice accepted by:</th>
<td></td>
</tr>
</tbody>
</table>
<p>
Font size
Default: 8

Counters Options

This section allows you to set current counters for each document. Counter number will be assigned to the new document and then automatically increased.

You can use counter in document settings with [prop name="doc_counter"] shortcode.

PDF Invoicing for WooCommerce - Counters Options

Shortcodes

Shortcodes can be used in “Number format”, “Header image”, “Header title”, “Header text”, “HTML style” and “HTML content” document settings.

[prop] shortcode

This is main plugin’s shortcode. It allows you to display various document, order, order item or order item product properties.

name attribute:

  • doc_counter
  • doc_nr
  • doc_formatted_date
  • doc_author_full_name
  • order_number
  • order_formatted_date_created
  • order_subtotal
  • order_total
  • order_total_in_words
  • order_total_tax
  • order_total_excl_tax
  • order_shipping_total
  • order_shipping_method
  • order_payment_method_title
  • order_formatted_billing_address
  • order_formatted_shipping_address
  • order_total_items_count
  • order_discount
  • order_discount_incl_tax
  • order_discount_tax
  • order_discount_percent
  • order_billing_first_name
  • order_details_email
  • order_details_table
  • order_meta
  • order_func
  • item_nr
  • item_name
  • item_qty
  • item_single
  • item_subtotal
  • item_subtotal_tax
  • item_total
  • item_total_tax_percent
  • item_total_incl_tax
  • item_total_tax
  • item_discount
  • item_discount_incl_tax
  • item_discount_tax
  • item_discount_percent
  • item_meta
  • item_func
  • item_product_id
  • item_product_taxonomy
  • item_product_sku
  • item_product_meta
  • item_product_func
Examples
[prop name="order_formatted_billing_address"]

[each_item] shortcode

[each_item] shortcode allows you to loop through the order items.

Examples
[each_item][prop name="item_nr"][prop name="item_name"][prop name="item_product_sku"][prop name="item_qty"][prop name="item_single" format="price"][prop name="item_total" format="price"]
</pre>
<p>[/each_item]

[/esc_html]

[clear] shortcode

This simple shortcode outputs empty line. Shortcode has no attributes.

Examples
[clear]