简体   繁体   English

从Woocommerce中已完成的订单电子邮件通知中删除订单明细表

[英]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.

相关问题 从 WooCommerce 处理订单 email 通知中删除订单详细信息 - Remove order details from WooCommerce processing order email notification Woocommerce订单已完成电子邮件通知 - Woocommerce Order Completed Email notification WooCommerce - 从订单详细信息和电子邮件中的产品标题中删除变化 - WooCommerce - Remove variation from product title in order details and email 从WooCommerce中的新订单电子邮件中删除银行帐户详细信息 - Remove bank account details from new order email in WooCommerce 从 WooCommerce 订单详细信息表中删除退款行 - Remove refund row(s) from WooCommerce order details table WooCommerce完成订单上的其他电子邮件 - WooCommerce additional email on completed order 如何在Woocommerce中自动发送客户发票/订单明细电子邮件通知 - How to send Customer invoice / Order details email notification Automatically In Woocommerce 从 Woocommerce email 通知中的订单表中删除运输行 - Remove the shipping row from the order table in Woocommerce email notifications 隐藏WooCommerce电子邮件已完成订单通知中的付款说明 - Hide payment instructions from WooCommerce email completed order notifications "在 WooCommerce 电子邮件通知的订单详细信息表中隐藏自定义费用行" - Hide custom fee row from order details table in WooCommerce email notifications
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM