Note: This article applies to the following document types:
- Invoice
- Packing Slip
- Dispatch Label
- Delivery Note
- Picklist
- Proforma Invoice
Store owners can remove unnecessary product metadata from the product table of documents using a custom code snippet. This custom code snippet works on all the document types with a product table. To achieve this, follow the below steps:
- Modify the code snippet below with the required product meta.
- Add the updated custom code snippet to the WordPress site.
Removing unnecessary product metadata
Below are the detailed steps for the same:
Step 1: Modify the custom code snippet
- In the custom code snippet given below, replace the default meta keys
Productmeta1
andProductmeta2
with the product meta to be removed. While replacing, make sure to add the correct field name of the meta (here, ‘Size’ and ‘Color’ are to be removed. So replaceProductmeta1
andProductmeta2
with ‘Size’ and ‘Color’ respectively).
The image below shows documents before adding the code snippet. All these documents have two product metas: Size and Color.
Step 2: Add the updated custom code snippet
- Add the custom code snippet to your WordPress site. Store owners can add the custom code snippet to the active child theme’s functions.php file or use a third-party plugin for the addition. For more details on adding custom code snippets using a third-party plugin, check out the following article: Adding Custom Codes with a Third-Party Plugin.
On removing the unnecessary product meta, the documents will look like this:
Discover More: