I am able to display SKU in a single product page using Product Meta data but it looks like same method does not work on Order Conformation page. Is there any way to echo SKU in a order conformation page? I was able to echo product name by using <?php foreach($order->get_items() as $item) { echo $product_name = $item['name'];} ?> but it is not working for SKU.

closed as off-topic by Rarst Jan 12 '14 at 19:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should be specific to WordPress within defined scope (merely happening in its context, such as generic PHP/JS/HTML/CSS, is insufficient). Might be better asked at Stack Overflow or other appropriate site of Stack Exchange network." – Rarst
If this question can be reworded to fit the rules in the help center, please edit the question.


Have you tried:

$productmeta = new WC_Product($id);
$sku = $productmeta->post->sku;

As seen here: Reference product SKU on WooCommerce confirmation page

Not the answer you're looking for? Browse other questions tagged or ask your own question.