Home > Docs > WooCommerce PDF Invoices, Packing Slips and Credit Notes Plugin > Sorting WooCommerce Packing Slips by Category and Product Name

Sorting WooCommerce Packing Slips by Category and Product Name

Last updated on February 23, 2024

Sorting items in a packing slip is vital for an efficient and error-free order fulfillment process. The WebToffee’s WooCommerce PDF Invoices, packing slips, and credit notes plugin helps to sort items in a packing slip by category and product name. To implement this, add the custom code snippet to the WordPress site and then enable the Group products by ‘Category’ option.

Step 1: Adding the custom code snippet

Add the custom code snippet below to the WordPress site. To do this, either add the custom code snippet to the active child theme’s functions.php file or use a third-party plugin. To know more about how to add a custom code snippet using a third-party plugin, refer to this article.

The custom code snippet is given below.

Step 2: Enabling the Group products by ‘Category’ option

Follow these basic steps to enable the Group products by ‘Category’ option.

  1. From the WordPress dashboard, navigate to Invoice/Packing slip > Packing slip.
  2. Under the General tab, navigate to the Product display section.
  3. Tick the checkbox against the Group products by ‘Category’ option to enable it, as shown below.
Enabling Group products by 'Category' option
Enabling Group products by ‘Category’ option
  1. As a final step, click on Update settings and save the changes.
Update Settings
Update Settings

Now, the plugin will automatically sort the products in a WooCommerce packing slip based on the category and product name.

The following image displays a packing slip sorted by category and product name in ascending order.

WooCommerce Packing slip with sorted items
WooCommerce Packing slip with sorted items