Created
December 11, 2013 20:55
-
-
Save maxrice/7918315 to your computer and use it in GitHub Desktop.
Get SKU from products in an order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$order = new WC_Order( $order_id ); | |
foreach ( $order->get_items() as $item_key => $item ) { | |
$product = $order->get_product_from_item( $item ); | |
$sku = $product->get_sku(); | |
// print_r( $item ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment