Including a clear description of the product or service offered by a wooCommerce store is a trivial part of invoicing. An invoice would need to include product-specific attributes such as colour, weight and quantity. In fact, they best describe a product. This article focuses on elaborating the steps needed to add product attributes as new columns in the product table of a WooCommerce invoice for better elaboration.
- A WooCommerce store with WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels extension enabled.
- Invoice enabled from the General settings tab.
Steps to add a product attribute as new column to an Invoice
Implement the following steps to add a new column to the product table of an invoice.
- In the WordPress dashboard, Click on Invoices/Packing > Invoices to reach the WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels plugins settings.
- Click on the Customize tab. This displays the default template of the Invoice.
- In the Customization window,move to the Product table in the Preview Pane and select it. This will display the Settings of the product table in the Editor Pane.
- Click on the “+” Icon at the top-right corner of the Editor pane. This displays the Add new column dialogue box.
- In the Dialogue box that appears, enter the name of the new column in the Column header text box.
- We can add a product attributes as new column to the product table using Filter. In the Select a value list box, you can select Filter option to add columns. This option adds custom values to the summary table. We use column keys to identify the column on the filter.
In the following example, we display the product attribute – color using Filter. Here, attribute is the column key. The values are entered as shown in the image below.
Add the following code to the function.php file to create a sample filter that calculates the discount.
Sample Invoice pdf after adding a new column using filters is as follows: