客户详细信息后的 WooCommerce 普通电子邮件通知有什么挂钩?
What hook for WooCommerce plain email notifications after customer details?
在 Woocommerce 普通电子邮件中显示的送货地址下方是否有一个挂钩?
我需要在运输字段下方插入一些文本,但我只能找到将在订单金额或产品名称中显示文本的挂钩。
您可以使用优先级高于 20
的以下挂钩,以普通电子邮件为目标,这将在客户详细信息之后(在账单和送货地址部分之后)显示所需的任何内容):
add_action ('woocommerce_email_customer_details', 'action_email_customer_details_callback', 21, 4);
function action_email_customer_details_callback( $order, $sent_to_admin, $plain_text, $email ){
// Only for "Plain text" email notifications
if ( ! $plain_text ) return;
// Your code goes here below
echo '<p>'.__("Test").'</p>';
}
代码进入您的活动子主题(或活动主题)的 functions.php 文件。它应该可以工作。
在 Woocommerce 普通电子邮件中显示的送货地址下方是否有一个挂钩?
我需要在运输字段下方插入一些文本,但我只能找到将在订单金额或产品名称中显示文本的挂钩。
您可以使用优先级高于 20
的以下挂钩,以普通电子邮件为目标,这将在客户详细信息之后(在账单和送货地址部分之后)显示所需的任何内容):
add_action ('woocommerce_email_customer_details', 'action_email_customer_details_callback', 21, 4);
function action_email_customer_details_callback( $order, $sent_to_admin, $plain_text, $email ){
// Only for "Plain text" email notifications
if ( ! $plain_text ) return;
// Your code goes here below
echo '<p>'.__("Test").'</p>';
}
代码进入您的活动子主题(或活动主题)的 functions.php 文件。它应该可以工作。