2

I am using WooCommerce Subscriptions and I found out how to change the text in the price string using my functions.php

Code:

// 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' );

Now I get this message:

$450.00 / month for 3 months and a $1,250.00 down payment

This is great but what I'd really like it to say is the reverse:

A $1,250.00 down payment and $450.00 / month for 3 months

Is there an easy way to do this in the functions.php?

MattM
  • 3,089
  • 7
  • 40
  • 62

1 Answers1

0

Add this to your functions.php

add_filter('woocommerce_subscriptions_product_price_string', 'woo_change_subscriptions_product_price_string' );
    function woo_change_subscriptions_product_price_string( $subscription_string ) {
    
            $subscription_string = "A $1,250.00 down payment and $450.00 / month for 3 months";
    
            return $subscription_string;
    }
ninjasense
  • 13,756
  • 19
  • 75
  • 92