【发布时间】:2018-08-31 00:30:30
【问题描述】:
我正在使用 WooCommerce 订阅,我发现了如何使用我的 functions.php 更改价格字符串中的文本
代码:
// WC Subscriptions - Custom Price String
function wc_subscriptions_custom_price_string( $pricestring ) {
$pricestring = str_replace( 'sign-up fee', 'down payment', $pricestring );
$pricestring = str_replace( 'with 1 month free trial', '', $pricestring );
return $pricestring;
}
add_filter( 'woocommerce_subscriptions_product_price_string', 'wc_subscriptions_custom_price_string' );
add_filter( 'woocommerce_subscription_price_string', 'wc_subscriptions_custom_price_string' );
现在我收到这条消息:
3 个月每月 450.00 美元,首付 1,250.00 美元
这很好,但我真正想说的是相反的:
首付 1,250.00 美元,3 个月每月 450.00 美元
在functions.php中是否有一种简单的方法来做到这一点?
【问题讨论】:
标签: wordpress string woocommerce woocommerce-subscriptions