Skip to content
Advertisement

Display a product custom field only in WooCommerce Admin single orders

This question follows How to show a product custom field (custom SKU) in WooCommerce orders answer to my previous question.

How do I make a product custom field articleid (custom SKU) to be visible only in Admin Order edit pages for each order item?

Also, it does not work for manual orders. How to display a product custom field articleid (custom SKU) on manual orders too?

Advertisement

Answer

Updated last function to avoid errors with other order item types that “line items”.

To make it only visible on admin, In your last function, you will need to change the order item meta key from 'articleid' to '_articleid' (adding an underscore at the beginning of the key) like:

JavaScript

For manual orders you will use the following:

JavaScript

Code goes in functions.php file of the active child theme (or active theme). Tested and works.

Related to this thread:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement