Last active
April 23, 2018 08:00
-
-
Save nicomollet/88a601d45648f32c7de90bbc0d6e55a2 to your computer and use it in GitHub Desktop.
WooCommerce Order Email: Each Item with product description
This file contains hidden or 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 | |
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