[英]Remove order details table from completed order email notification in Woocommerce
I am trying to remove the order details table from every completed order mail: 我正在尝试从每个已完成的订单邮件中删除订单详细信息表 :
I have tried something like this: 我已经尝试过这样的事情:
function so_39251827_remove_order_details( $order, $sent_to_admin, $plain_text, $email ){
$mailer = WC()->mailer(); // get the instance of the WC_Emails class
remove_action( 'woocommerce_email_order_details', array( $mailer, 'order_details' ), 10, 4 );
}
add_action('woocommerce_email_order_details','so_39251827_remove_order_details', 5, 4 );
It actually did remove the table but I am thinking the hook is removed from entirely all mail notifications, that's both the admin and customer mail template. 它实际上确实删除了表,但是我认为挂钩是从所有邮件通知中删除的,即通知邮件和管理邮件模板。
Can somebody help me on how to remove it from only completed order mail sent to customers? 有人可以帮助我如何将其从仅发送给客户的已完成订单邮件中删除吗?
copy this email template \\wp-content\\plugins\\woocommerce\\templates\\emails\\customer-completed-order.php 复制此电子邮件模板\\ wp-content \\ plugins \\ woocommerce \\ templates \\ emails \\ customer-completed-order.php
to your theme here \\wp-content[theme_folder]\\woocommerce\\emails\\customer-completed-order.php 此处为您的主题\\ wp-content [theme_folder] \\ woocommerce \\ emails \\ customer-completed-order.php
and comment our this line 并评论我们这一行
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); do_action('woocommerce_email_order_details',$ order,$ sent_to_admin,$ plain_text,$ email);
that should remove the order details table just from the customer email. 只需从客户电子邮件中删除订单明细表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.