我想从我的买家下订单后woocommerce将发送的电子邮件模板中删除下载部分。
在买方的订单仍处于暂停,处理和退款状态时,将下载链接发送给我的买方是没有意义的。
请参考以下图片:
我当前处于保留状态的电子邮件模板:
<?php
/**
* Customer on-hold order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-on-hold-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 2.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php _e( "Your order is on-hold until we confirm payment has been received. Your order details are shown below for your reference:", 'woocommerce' ); ?></p>
<?php
/**
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
我仍然想保留订单详细信息,我只是想从电子邮件中删除下载部分。
我们将不胜感激任何帮助。
答案 0 :(得分:0)
至少由于Woocommerce 3.2版通常会显示“产品下载”部分,因此仅在订单状态完成或商店经理允许下载订单时才会出现。 因此,您的Woocommerce安装中出现了问题。
现在,如果您不能解决问题,该怎么办,就是删除原来的挂钩功能,该功能在电子邮件通知中显示“产品下载”部分,然后将其替换为一个类似的“显示产品下载”部分的功能< strong>仅当订单状态完成时。
代码:
IV
代码进入您的活动子主题(或活动主题)的function.php文件中。经过测试,可以正常工作。