Skip to content

Instantly share code, notes, and snippets.

@protorob
Created December 27, 2019 16:50
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 protorob/02ffd33e1807e8c82622245fad758c38 to your computer and use it in GitHub Desktop.
Save protorob/02ffd33e1807e8c82622245fad758c38 to your computer and use it in GitHub Desktop.
Add SKU to items in order email - woocommerce
function artomultiplo_add_sku_woocommerce_emails( $output, $order ) {
// set a flag so we don't recursively call this filter
static $run = 0;
// if we've already run this filter, bail out
if ( $run ) {
return $output;
}
$args = array(
'show_sku' => true,
);
// increment our flag so we don't run again
$run++;
// if first run, give WooComm our updated table
return $order->email_order_items_table( $args );
}
add_filter( 'woocommerce_email_order_items_table', 'artomultiplo_add_images_woocommerce_emails', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment