【问题标题】:Remove WooCommerce subscription duration from cart and checkout pages从购物车和结帐页面中删除 WooCommerce 订阅期限
【发布时间】:2022-02-18 20:10:49
【问题描述】:

我正在尝试删除 Woocommerce 订阅的购物车和结帐页面上的 duration

所以不是$99 / month for 12 months,而是$99 / month (${price} / {period})

以下主题的解决方案会删除价格后的整个字符串。也许它有助于为我的案例找到解决方案。 (Remove WooCommerce subscription interval from cart and checkout pages)

有用的资源:@​​987654322@

我希望有人可以帮助我解决这个问题。谢谢

【问题讨论】:

    标签: php woocommerce cart checkout woocommerce-subscriptions


    【解决方案1】:
    add_filter('wcs_cart_totals_order_total_html', 'modify_wcs_cart_totals_order_total_html', 100, 2);
    
    function modify_wcs_cart_totals_order_total_html($order_total_html, $cart) {
        $recurring_total_string = explode('für', $order_total_html);
        $recurring_first_string = explode('Erste', $order_total_html);
        return $recurring_total_string[0]. '<div class="first-payment-date"><small>Erste'.$recurring_first_string[1].' </small></div>';
    }
    

    【讨论】:

    猜你喜欢
    • 2020-10-27
    • 2020-05-02
    • 2018-10-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-24
    • 1970-01-01
    • 2017-06-05
    • 2016-03-20
    相关资源
    最近更新 更多