FluentForm recurring payment summary text

tdrayson

A user in the Fluent Form facebook group wanted a way to change trial text.

After having a look through the source code, I found that there was a filter that can be used to update the text that shows up.

Payment summary text

If you want to translate or change the text including signup fee, trials, bill amounts etc. You can do that with the code below.


        /**
 * Change the payment summary texts in Fluent Forms.
 *
 * @param array $paymentSummaryText The existing payment summary messages.
 * @param object $plan The subscription plan details.
 * @param int $formId The ID of the form.
 * @return array The modified payment summary messages.
 * 
 * @since 15/05/2024
 * @link https://snippetclub.com/fluentform-recurring-payment-summary-text/
 * 
 * @author Taylor Drayson
 */
function tct_recurring_payment_summary_texts( $paymentSummaryText, $plan, $formId ) {
    
    $paymentSummaryText['has_trial'] = 'Free for {trial_days} days then {subscription_amount} for each {billing_interval}';
    
    return $paymentSummaryText;
}
add_filter( 'fluentform/recurring_payment_summary_texts', 'tct_recurring_payment_summary_texts', 10, 3 );
      
Copy

Default text and keys

Below is the list of the keys and the default texts that are currently set. To change them, use the example above and add your own by replacing the key inside the brackets. $paymentSummaryText['KEY_HERE'].

Anywhere you see {} is a dynamic placeholder, be sure to include these in to pull the correct information.

  • has_signup_fee – “{first_interval_total} for first {billing_interval} then {subscription_amount} for each {billing_interval}”
  • has_trial – “Free for {trial_days} days then {subscription_amount} for each {billing_interval}”
  • onetime_only – “One time payment of {first_interval_total}”
  • normal – “{subscription_amount} for each {billing_interval}”
  • bill_times – “, for {bill_times} installments”
  • single_trial – “Free for {trial_days} days then {subscription_amount} one time”

👋🏻 Weekly Tutorial Digest

I send out a weekly newsletter with links to new tutorials written in the last week, you can subscribe below.

Newsletter

🔒I won't send you spam, I promise