I’m new to PHP and also new to WooCommerce. I would like to remove the meta in red, but it is actually a span in the email.
I’ve tried adding this code to modify email CSS, but is there a way to just target the concerned text?
add_filter( 'woocommerce_email_styles', 'add_css_to_emails', 10, 2 );
function add_css_to_emails( $css, $email ) {
$css .= '
td:first-child{font-size: 0px }
';
return $css;
}
add_filter( 'woocommerce_email_styles', 'add_css_to_emails', 10, 2 );
function add_css_to_emails( $css, $email ) {
$css .= '
td:first-child span{font-size: 0px }
';
return $css;
}
2
Answers
WooCommerce uses template files to generate customer emails. You’ll need to find the template file responsible for the specific email you want to customize. In this case, it looks like you want to customize the order details table in the email.
Please check above file
Once you’ve located the template file, copy it to your theme’s folder or child theme’s folder. This ensures that your changes won’t be overridden when WooCommerce or your theme is updated.
I hope it will help you someone..!
Add the below code snippet in your active theme’s
functions.php
in order to hide order item meta within email template.