【问题标题】:Woocommerce Subscriptions How to Remove Checkout InformationWoocommerce 订阅如何删除结帐信息
【发布时间】:2015-09-09 02:59:04
【问题描述】:

我正在建立一个会员网站,在该网站上,付费会员可以在有限的时间内成为会员。所以没有月费。我已将 woocommerce 订阅的月费设置为 ​​0 美元/月。

但问题是结帐页面中显示 x 个月每月 0 美元,这只是不必要的信息,我只想显示注册费并且没有每月经常性金额。

最好的方法是什么?

阿马尔

【问题讨论】:

  • 您可以通过woocommerce_subscriptions_product_price_string 过滤woocommerce_subscriptions_product_price_string_inclusions 数组或完整字符串。请参阅class-wc-subscriptions.php 类中的get_price_string() 方法。

标签: wordpress woocommerce subscriptions


【解决方案1】:

这是在functions.php中对我有用的:

function my_example_filter( $include, $product ) {

    $mynewarray = array(
                'tax_calculation'     => false,
                'subscription_price'  => true,
                'subscription_period' => true,
                'subscription_length' => false,
                'sign_up_fee'         => false,
                'trial_length'        => false
            );

    return $mynewarray;
}

这里只剩下价格和期限。

add_filter( 'woocommerce_subscriptions_product_price_string_inclusions', 'my_example_filter', 10, 2);

【讨论】:

    猜你喜欢
    • 2021-05-17
    • 1970-01-01
    • 2020-10-27
    • 1970-01-01
    • 2021-04-22
    • 2022-10-15
    • 2014-04-24
    • 2020-11-23
    • 2019-07-19
    相关资源
    最近更新 更多