Skip to content

Instantly share code, notes, and snippets.

@stuartduff
Last active September 7, 2017 15:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartduff/d35826c4266a2152eb6f05bd6e65119c to your computer and use it in GitHub Desktop.
Save stuartduff/d35826c4266a2152eb6f05bd6e65119c to your computer and use it in GitHub Desktop.
This filter will add SKU numbers to your WooCommerce emails in v2.6 and above
// Edit order items table template defaults
function sd_add_wc_order_email_sku( $table, $order ) {
ob_start();
$template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
wc_get_template( $template, array(
'order' => $order,
'items' => $order->get_items(),
'show_download_links' => $show_download_links,
'show_sku' => true,
'show_purchase_note' => $show_purchase_note,
'show_image' => $show_image,
'image_size' => $image_size
) );
return ob_get_clean();
}
add_filter( 'woocommerce_email_order_items_table', 'sd_add_wc_order_email_sku', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment