- warbird
- Comments Off on WooCommerce PDF Invoicing and Packing Slips
- PDF Invoicing and Packing Slips

Description
WooCommerce PDF Invoicing and Packing Slips module adds functionality for PDF invoices, proforma invoices, credit notes, packing slips and custom docs to WooCommerce. Each document type has its own numbering system, comes with a fully customizable template, styling, page settings, a customizable header & footer, display and emailing options. All the invoicing and offline packing documents you need to streamline your WooCommerce orders and paperwork! For more information on the specific settings, read on below.
Settings Sections
General
In this section you can select which of document types do you need and when those documents should be created, and also disable unwanted documents. Standard, though not obligatory, documents creation settings would create a proforma invoice and packing slips on a new order, and invoice creation is delayed till order is complete. Credit notes would be created on order refund. You can also create invoices on custom order statuses if you have created a custom order status (see Booster’s WooCommerce Custom Statuses Module). Documents can be created on multiple statuses. In this case document is created only once, when order is updated to any selected status.

Report Tool

Numbering
In this section you can set the number format you want to use for each document. If the sequential checkbox is unchecked, the order ID is used. Prefix and suffix can contain shortcodes (Booster’s or not), such as – if you need order’s year and month to be included in invoice’s number, try
. These settings will define the number format for all feature orders. If you need to create invoices for existing orders, or if you need to renumber invoices for any other reason, you can use Renumerate Invoices tool, accessible through WooCommerce > Booster Tools > Renumerate Invoices.

Templates
HTML template should be extended by Booster for WooCommerce Shortcodes. Basically you can use the default template as is, except that you need to enter your (i.e. seller) details – replace “COMPANY NAME”, “COMPANY ADDRESS 1” and “COMPANY ADDRESS 2” with required values.
Invoice<br />
You can find full multilanguage invoice template example here.
shortcode.
Styling
You can use some basic CSS to style your invoices (please note that not all CSS features are available). In this section you can also set the default font family and properties, however invoice font can also be changed by adding `font-family` property to CSS, e.g. `p { font-family: “Times New Roman”, Georgia, Serif; }`.

Header
In this section you can enable or disable the header for each document type. You can add an image to the header, however please notice that this image must be on the same local server. Your image width must be set in millimeters (e.g. A4 page width is 210 mm). Alternatively to setting image in header, you can use the standard `<img>` tag in the HTML Template. Header title, header text and header image can contain shortcodes, however HTML tags will not be processed. For example, this way you can create different headers for different countries by using “ shortcode with `billing_country` attribute (see example in “Templates” section above).

Footer

Page Settings
In this section you can choose the page orientation (portrait or landscape) and page format (e.g. A1, A8 etc. paper size). You can also set page margins in this section to ensure your invoice is tidy and aligned.

Email Options
Choose an action for when you want to attach your invoice to an email. Booster will automatically add all emails to the list. This includes custom emails created with Booster’s Custom Emails module and any other custom emails created with some external plugin. The same document can be attached to multiple emails. Please note, that you must ensure that the document you wish to attach is created before an email. E.g. if you wish to send an invoice on new order, the invoice must be also created on new order and not on e.g. order completed.
You can also select which payment gateways to include when attaching the document to email. For example you may want to attach proforma invoices for direct bank transfer gateways only. If you leave this fields empty – document will be attached for all payment gateways.

Display & Misc.
New invoices will appear in the orders list, with each document in its own Invoice, Proforma Invoice or Packing Slip column. You can disable these columns (for example, if a shop manager were to handle the invoices through email). A link to invoices can also be added to your customers’ My Account page. This section also lets you switch between showing PDF documents in browser, or saving them to your hard drive.

Developers
Modifying Cell Output
If you wish to modify table cell output for “ shortcode, you can use `wcj_pdf_invoicing_cell_data` filter. For example, if you need to make item names bold in table, add this snippet to your (child) theme’s functions.php file:
add_filter( ‘wcj_pdf_invoicing_cell_data’, ‘make_bold_title_in_booster_pdf_invoice’, 10, 2 );<br /> if ( ! function_exists( ‘make_bold_title_in_booster_pdf_invoice’ ) ) {<br /> function make_bold_title_in_booster_pdf_invoice( $cell_data, $args ) {<br /> if ( ‘item_name’ === $args[‘column’] ) {<br /> $cell_data = ‘<strong>‘ . $cell_data . ‘</strong>‘;<br /> }<br /> return $cell_data;<br /> }<br /> }
Parameters in `$args` array are:
array(<br /> ‘column’,<br /> ‘column_param’,<br /> ‘item’,<br /> ‘item_id’,<br /> ‘item_counter’,<br /> ‘product’,<br /> ‘order’,<br /> );
Adding Custom Fonts
In case if you want to add more fonts to Booster’s PDF invoicing module, you can do so with `wcj_pdf_invoicing_fonts` filter. What you need to do is:
1. Prepare TCPDF font files (for example with this tool).
2. Upload your custom fonts files to …/wp-content/uploads/woocommerce_uploads/wcj_uploads/tcpdf_fonts folder on your server.
3. Go to your (child) theme’s functions.php file and add something like this:
add_filter( ‘wcj_pdf_invoicing_fonts’, ‘add_custom_fonts_to_booster_pdf_invoices’ );<br /> function add_custom_fonts_to_booster_pdf_invoices( $fonts ) {<br /> $fonts[‘font_id’] = ‘Label’;<br /> $fonts[‘another_font_id’] = ‘Another label’;<br /> return $fonts;<br /> }
After that new fonts should be available in “WooCommerce > Settings > Booster > PDF Invoicing & Packing Slips > Styling”. You can set `Label` to any value, and `font_id` is filename of your font without extension.
Tips & Tricks
- WooCommerce > Settings > Booster > PDF Invoicing and Packing Slips