Created
December 27, 2019 16:50
-
-
Save protorob/02ffd33e1807e8c82622245fad758c38 to your computer and use it in GitHub Desktop.
Add SKU to items in order email - woocommerce
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
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