Created
May 30, 2015 09:02
-
-
Save vanbo/2a27671a9ca7af7850cc to your computer and use it in GitHub Desktop.
Get order items full product description
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
/** | |
* You need the order object here. | |
* So we'll assume you already have it. | |
* | |
* To get the order you can call | |
* $order = wc_get_order( $order_id ); | |
*/ | |
// Get Order items | |
$items = $order->get_items(); | |
foreach( $items as $key => $item ) { | |
// Get the product | |
$item_product = $order->get_product_from_item( $item ); | |
// Echo the item description | |
echo $item_product->post->post_content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment