【问题标题】:Remove Cash On Delivery Instructions From WooCommerce Emails从 WooCommerce 电子邮件中删除货到付款说明
【发布时间】:2017-05-05 01:00:06
【问题描述】:

这是我的电子邮件目前的样子:

我花了一些时间试图删除这个: 'Pay wish cash upon arriving to destination.'

但不移除其他东西就无法让它消失。

如果可以的话,请帮忙。

谢谢。

【问题讨论】:

    标签: php wordpress woocommerce hook-woocommerce email-notifications


    【解决方案1】:

    ——更新 1——

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

    您将能够删除“到达目的地时支付wish cash”。说明消息,或者用更方便的东西替换它。


    您可以尝试使用 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 文件中。

    您也可以将文本替换为其他内容。

    【讨论】:

    • 抱歉,我不能让它工作。即使将函数名称更改为 remove_email_text 它仍然没有改变任何东西。请指教。
    • @JackRobson Cool 最后它正在处理答案更新......
    • 我无法让 gettext 过滤器工作,但从 WooCommerce 设置中删除文本效果很好。谢谢你的帮助。对 gettext 过滤器感到羞耻,我现在必须用单词 booking 替换所有 order 实例,并且很难找到它们。有什么建议吗?
    猜你喜欢
    • 2015-08-24
    • 1970-01-01
    • 2019-10-12
    • 1970-01-01
    • 2017-05-31
    • 1970-01-01
    • 2019-07-30
    • 2021-12-27
    • 1970-01-01
    相关资源
    最近更新 更多