Skip to content

Instantly share code, notes, and snippets.

@vanbo
Created May 30, 2015 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanbo/2a27671a9ca7af7850cc to your computer and use it in GitHub Desktop.
Save vanbo/2a27671a9ca7af7850cc to your computer and use it in GitHub Desktop.
Get order items full product description
/**
* 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