如何更改 WooCommerce 中“经常性总计”下方的文本?

问题描述 投票:0回答:1

我指的是: enter image description here

当前显示“首次续订:2025 年 5 月 6 日”-我想更改该文本。我认为我可以用 PHP 做一些事情,但我不确定在哪里可以找到/如何修复。

php wordpress woocommerce
1个回答
0
投票

弄清楚了 - 在 wcs-cart-functions.php 中找到了该函数

function wcs_add_cart_first_renewal_payment_date( $order_total_html, $cart ) {
    if ( 0 !== $cart->next_payment_date ) {
            $first_renewal_date = date_i18n( wc_date_format(), wcs_date_to_time( get_date_from_gmt( $cart->next_payment_date ) ) );
            // translators: placeholder is a date
            $order_total_html  .= '<div class="first-payment-date"><small>' . sprintf( __( 'First renewal: %s', 'woocommerce-subscriptions' ), $first_renewal_date ) .  '</small></div>';
        }

        return $order_total_html;
    }
    add_filter( 'wcs_cart_totals_order_total_html', 'wcs_add_cart_first_renewal_payment_date', 10, 2 );

将“第一次续订:”更改为您想要的任何内容。

© www.soinside.com 2019 - 2024. All rights reserved.