【问题标题】:Woocommerce Subscription - Changing Free Trial TextWoocommerce 订阅 - 更改免费试用文本
【发布时间】:2017-03-22 00:45:56
【问题描述】:

感谢您阅读这篇文章。我一直在尝试更改 Woocommerce 订阅中的“免费试用”文本。我能够找到更改“注册费”的代码,但无法找到更改此其他部分的功能。

    function change_subscription_product_string( $subscription_string, $product, $include ){
if( $include['sign_up_fee'] ){
    $subscription_string = str_replace('sign-up fee', '= total price. After intro period subscription will renew monthly.', $subscription_string);
}
return $subscription_string; } add_filter( 'woocommerce_subscriptions_product_price_string', 'change_subscription_product_string', 10, 3 );

我目前创建的代码是:“1 个月 199.00 美元,2 个月 免费试用 和 398.00 美元 = 总价。在介绍期之后,订阅将每月续订。”

需要更改为“1 个月 199.00 美元,2 个月最低和 398.00 美元 = 总价。在介绍期之后,订阅将每月续订。

【问题讨论】:

  • 想看看是否有人知道可能影响此部分的辅助字符串?

标签: string woocommerce subscription subscriptions


【解决方案1】:

我在这个 sn-p 上取得了成功:

function wc_subscriptions_custom_price_string( $pricestring ) {
    $newprice = str_replace( 'free trial', 'minimum', $pricestring );
    return $newprice;
}
add_filter( 'woocommerce_subscriptions_product_price_string', 'wc_subscriptions_custom_price_string' );
add_filter( 'woocommerce_subscription_price_string', 'wc_subscriptions_custom_price_string' );

来自Woo的官方woogist github gist account通过nicola.blog

【讨论】:

    猜你喜欢
    • 2014-02-01
    • 2018-08-02
    • 2016-05-02
    • 2020-08-14
    • 2018-11-17
    • 2018-06-09
    • 1970-01-01
    • 2018-01-02
    • 2023-03-31
    相关资源
    最近更新 更多