标题WooCommerce Gateway

发布于 2025-01-24 03:43:09 字数 196 浏览 1 评论 0原文

我尝试修改以税收收据显示的付款网关标题。但是,找不到在哪里改变这一点。

我有我想要的“ BAC” - >毒人银行 我有我想要的“ monetico” - > CB

By'.$order->get_payment_method().'.

我可以听所有答案。

提前致谢

I try to modify the title of my payment gateways who are displayed in a tax receipt. But Don't find where to change this.

I have "BACS" that I want to --> virement bancaire
I have "Monetico" that I want to --> CB

By'.$order->get_payment_method().'.

I can listen all answers.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傾城如夢未必闌珊 2025-01-31 03:43:09

挂钩woocommerce_oder_get_payment_method_title用于更改与订单一起存储的付款方法标题。它不会在结帐页面中更改付款方式标题。

add_filter('woocommerce_order_get_payment_method_title', 'alter_payment_method_title', 10, 2);

function alter_payment_method_title($payment_method_title, $order) {

    if ('Direct Bank Transfer' === $payment_method_title) {
        $payment_method_title = 'virement bancaire';
    }
    if ('Monetico' === $payment_method_title) {
        $payment_method_title = 'CB';
    }
    if ('Cash on delivery' === $payment_method_title) {
        $payment_method_title = 'Cash on arrival';
    }
    return $payment_method_title;
}

使用WooCommerce 6.4

在Active主题function.php文件中添加上述代码。

The hook woocommerce_order_get_payment_method_title is used to change the payment method title that is stored with the order. It will not change the payment method title in the checkout page.

add_filter('woocommerce_order_get_payment_method_title', 'alter_payment_method_title', 10, 2);

function alter_payment_method_title($payment_method_title, $order) {

    if ('Direct Bank Transfer' === $payment_method_title) {
        $payment_method_title = 'virement bancaire';
    }
    if ('Monetico' === $payment_method_title) {
        $payment_method_title = 'CB';
    }
    if ('Cash on delivery' === $payment_method_title) {
        $payment_method_title = 'Cash on arrival';
    }
    return $payment_method_title;
}

Tested ok With WooCommerce 6.4

Add the above code to your active theme functions.php file

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文