Hide SKU in new order email template

449 Views Asked by At

How do I customize woocommerce_email_order_meta to hide the SKU?

I see snippets like this but it also hides them in the product page. I only want to hide the SKU in New Order email.

function sv_remove_product_page_skus( $enabled ) {
    if ( ! is_admin() && is_product() ) {
        return false;
    }

    return $enabled;
}
add_filter( 'wc_product_sku_enabled', 'sv_remove_product_page_skus' );

Let me know your thoughts, thank you!!

1

There are 1 best solutions below

0
Info Domain On

Look in email-order-items.php You see this line

// SKU.
if ( $show_sku && $sku ) {
echo wp_kses_post( ‘ (#’ . $sku . ‘)’ );
}

You can comment out the echo line with // so:

// SKU.
if ( $show_sku && $sku ) {
  // echo wp_kses_post( ' (#' . $sku . ')' );
}