Woocommerce: Remove variant options from admin new order email

I would like to ask for some helpadvice. Currently, we use the admin new order email as a picking list that gets prin

I would like to ask for some help / advice. Currently, we use the admin new order email as a picking list that gets printed off, but we now have an average of 3 variations per product and the printed name is now getting rather long, as per the format below.

what I would like to ask help for is to determine which hooks control the naming so I can remove all the variant elements, (leaving standard name and sku) and to then apply it to the admin email only.

My initial thought is to do something like the below, but I cannot see how i can determine if it is an admin email or not as I don't have access to $email..

Any help is appreciated.


function variation_title_not_include_attributes( $boolean ){ 

if (  is_email() )  {
$boolean = false; 
return $boolean; 
}
return true;
}
Current Sample output:

Test product (Test SKU)
•   Variant 1: 
Variant 1 Option
•   Variant 2: 
Variant 2 Option
•   Variant 3: 
Variant 3 Option

I would like to ask for some help / advice. Currently, we use the admin new order email as a picking list that gets printed off, but we now have an average of 3 variations per product and the printed name is now getting rather long, as per the format below.

what I would like to ask help for is to determine which hooks control the naming so I can remove all the variant elements, (leaving standard name and sku) and to then apply it to the admin email only.

My initial thought is to do something like the below, but I cannot see how i can determine if it is an admin email or not as I don't have access to $email..

Any help is appreciated.


function variation_title_not_include_attributes( $boolean ){ 

if (  is_email() )  {
$boolean = false; 
return $boolean; 
}
return true;
}
Current Sample output:

Test product (Test SKU)
•   Variant 1: 
Variant 1 Option
•   Variant 2: 
Variant 2 Option
•   Variant 3: 
Variant 3 Option
Share Improve this question asked Jul 11, 2019 at 8:45 SteveSteve 212 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

One approach would be to override woocommerce/templates/emails/email-order-items.php (and possibly the version for plain-text emails) with your own version. It has access to $sent_to_admin, so you could replace its call to echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); with your own.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745329395a4622807.html

相关推荐

  • Woocommerce: Remove variant options from admin new order email

    I would like to ask for some helpadvice. Currently, we use the admin new order email as a picking list that gets prin

    4小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信