You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
we append some kind of extra group key to the recurring cart containing that product, like a sanitized version of the price string
add support for a variable in the string, e.g. {price}, so the same string can be used, but with tax, shipping etc. added to it by the cart
filter the cart & checkout strings for that recurring cart
The text was updated successfully, but these errors were encountered:
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
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 cartThe text was updated successfully, but these errors were encountered: