php - 从 WooCommerce 电子邮件中删除货到付款说明

标签 php wordpress woocommerce hook-woocommerce email-notifications

这是我的电子邮件目前的样子: enter image description here

我花了一些时间尝试删除这个: “到达目的地后支付愿望现金。”

但如果不删除其他内容,就无法让它消失。

如果可以的话请帮忙。

谢谢。

最佳答案

—更新1—

在后端,如果您转到 WooCommerce > 设置 > 结帐 > 货到付款(选项卡),您将看到:

enter image description here

You will be able to remove "Pay wish cash upon arriving to destination." instructions message, or to replace it with something more convenient.


您可以尝试使用WordPress gettext()函数将以这种方式删除您的文本:

add_filter( 'gettext', 'removing_email_text', 10, 3 );
function customizing_checkout_text( $translated_text, $untranslated_text, $domain )
{
    if ( 'Pay wish cash upon arriving to destination.' == $untranslated_text ) {
        $translated_text = __( '', $domain );
    }
    return $translated_text;
}

此代码位于事件子主题的 function.php 文件中(事件主题或任何插件文件)。

您还可以用其他内容替换文本。

关于php - 从 WooCommerce 电子邮件中删除货到付款说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41231686/

相关文章:

php - Woocommerce 注册中的附加用户角色选择字段

php - Woocommerce - 从订购的产品中获取元数据

javascript - 如何提交由动态列和行组成的表单

php - MySQL 中的 limit vs exists vs count(*) vs count(id)

php - 复杂的连接查询

php - WordPress 在自定义管理菜单下显示分类法

php - WP_query 与数组中的多个值不匹配

php - Composer 多个应用程序使用路径存储库本地和服务器上的 vcs

wordpress - 我如何在 wordpress 的每个类别中只获得 1 个帖子

php - 在 WooCommerce 中设置除产品标签之外的最低订单值(value)