I would like to output the Product Short Description beneath the product name inside the order items table inside WooCommerce emails. I think I know where to place code inside the email template file, but I don’t know how to access the description of an item. I don’t see any mechanism to retrieve it. What do I need to do to echo out the field?
Thanks in advance!
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
I finally tried using
$_product, which are both used in the
$_product revealed a
post object, which itself has a
post_excerpt property, which looks like it holds the contents of the “Product Short Description” from the WooCommerce product form.
So, to add the description beneath the item name, I added this to my code:
echo '<br/>' . $_product->post->post_excerpt;
Voilà! The short description appears in the email!
Hope this helps someone else! Took me a couple hours of frustration to get it.