Open thenbrent opened 5 years ago
3332586-zen
The customer in 3332586-zen shared their solution:
/**
* Subscription - change the FREE TRIAL pricing string in cart, checkout and elsewhere 30 sept 2020
*/
function wc_subscriptions_custom_price_string( $pricestring ) {
$pricestring = str_replace( 'free trial and', 'is pre-paid today via', $pricestring );
$pricestring = str_replace( 'with a', 'starting on the 15th of the month. Your first', $pricestring );
$pricestring = str_replace( 'sign-up fee', 'payment', $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' );
The outcome is this string appearing in the cart: Red is all the dynamic content.
$225.00 every 3 months starting on the 15th of the month. Your first 3-month is pre-paid today via a $225.00 payment
Another case is 29105259-hc
3934883-zen
At the moment, the price string displayed is only for the product price. It would be possible to also apply that string to the cart & checkout recurring totals tool if:
{price}
, so the same string can be used, but with tax, shipping etc. added to it by the cart