简体   繁体   English

您如何更改 WooCommerce 我的帐户中的订阅文本?

[英]How do you change subscription's text in WooCommerce my account?

I created a subscription product pay $1 today and $99 after a month of trial but since there was no such option I used the "every 6 years" option.我创建了一个订阅产品,今天支付 1 美元,试用一个月后支付 99 美元,但由于没有这样的选项,我使用了“每 6 年”选项。 Now when people go to subscriptions to cancel the 99 charge they see "$99.00 every 6 years".现在,当人们 go 订阅取消 99 收费时,他们看到“每 6 年 99.00 美元”。 Both in my-account/view-subscription/4619/ and my-account/subscriptions Is there a way to change this text without installing the translator app which will further bulk my already overbulked with plugins installation?在 my-account/view-subscription/4619/ 和 my-account/subscriptions 中有没有办法在不安装翻译器应用程序的情况下更改此文本,这将进一步增加我已经超载的插件安装? 在此处输入图像描述

To answer your point that there was no such option, if you edit a product and scroll down to the Product settings, as long as the product type is "Simple Subscription" then the general tab has settings for free trial, so you can set your sign up fee as $1, your free trial as 30 days, then your subscription price as $99 per month or year, whatever it is you are wanting to do.要回答你没有这样的选项的观点,如果你编辑产品并向下滚动到产品设置,只要产品类型是“简单订阅”,那么常规选项卡就会有免费试用的设置,所以你可以设置你的注册费为 1 美元,免费试用 30 天,然后订阅费为每月或每年 99 美元,无论您想做什么。

add_filter('woocommerce_get_formatted_subscription_total', 'woocommerce_get_formatted_subscription_total', 10, 2);

function woocommerce_get_formatted_subscription_total($formatted_total, $subscription_obj) {
    if (is_wc_endpoint_url('subscriptions')) { // On subscriptions page, return only the price
        return wc_price($subscription_obj->get_total());
    }
    return $formatted_total;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM