Skip to content
Advertisement

How to add product SKUs to WooCommerce new order email subject

Based on Woocommerce – Add username to new order email subject line. I’m trying to change WooCommerce email subject lines. Тhe email which I receive as site administrator in my mail when have a ordering.

I’m trying to create the following structure

[Online store]Order(#….)Name,Second name, Total-…,SKU1, SKU2, SKU3…

I use this code but I don’t know how to get the SKU for every each product in the order?

JavaScript

Advertisement

Answer

You could use the following for this, the product SKUs are obtained via foreach loop from the order object.

Added comment with explanation to code

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