Skip to content

Instantly share code, notes, and snippets.

@nicomollet
Last active April 23, 2018 08:00
Show Gist options
  • Save nicomollet/88a601d45648f32c7de90bbc0d6e55a2 to your computer and use it in GitHub Desktop.
Save nicomollet/88a601d45648f32c7de90bbc0d6e55a2 to your computer and use it in GitHub Desktop.
WooCommerce Order Email: Each Item with product description
<?php
add_action( 'woocommerce_order_item_meta_start', 'custom_order_email_product_description', 10, 4 );
function custom_order_email_product_description( $item_id, $item, $order, $plain_text = '' ){
$item_data = $item->get_data();
$product = wc_get_product($item_data['product_id'] );
$product_short_description = $product->get_short_description();
$product_description = $product->get_description();
if ( ! empty( $product_short_description ) ) {
echo $product_short_description;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment