Skip to content
Advertisement

How to show a product custom field (custom SKU) in WooCommerce orders

Is there a way to display my custom SKU under each product on the WooCommerce order page?

The custom sku displays fine when I edit the product, but it does not display in the order page for the product. I need this information to show on the order so that Zapier can match it with the Visma Account Software ArticleID of the product.

This attempt is based on the solution How to add a (second) custom sku field to WooCommerce products?

JavaScript

Advertisement

Answer

You could use the hook woocommerce_checkout_create_order_line_item to save this product custom field as custom order Item data, when order is placed, as follows (and display it everywhere on orders and emails):

JavaScript

And the following to change “articleid” displayed label slug with “ArticleID” readable label name (on customer orders and email notifications):

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