小编Ris*_*shi的帖子

如何更改WooCommerce订阅中的注册费用文本?

到目前为止,我已经尝试将以下代码添加到我的functions.php中,但没有运气:

<?php
function my_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
        case 'Sign-up Fee' :
            $translated_text = __( 'bin deposit', 'woocommerce-subscriptions' );
            break;
        case 'Apply Coupon':    
            $translated_text = __( 'Enter Coupon', 'woocommerce' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
?>
<?php
function my_signupfee_string( $pricestring ) {

    $newprice = str_replace( 'sign-up fee', 'bin deposit', $pricestring );
return $newprice;

}

add_filter( 'woocommerce_subscriptions_sign_up_fee', 'my_signupfee_string' );
?>
Run Code Online (Sandbox Code Playgroud)

这些功能都不起作用,我是新手更改插件的内部插件.

php subscriptions woocommerce

4
推荐指数
1
解决办法
3150
查看次数

标签 统计

php ×1

subscriptions ×1

woocommerce ×1