Hi everyone,
I’m working on a setup where I have a Custom Post Type (CPT) called “Plans”, and each plan has a custom field plan_duration (values like 1 year, 2 years).
I want to create a Gravity Form subscription where the billing interval is dynamically set based on the selected plan’s duration. For example:
-
Plan A → 1-year subscription
-
Plan B → 2-year subscription
Here’s what I’ve tried / considered:
-
Created a Product Field → Subscription in Gravity Forms.
-
Created a Stripe Feed for subscriptions.
-
Tried to dynamically populate the subscription interval from the plan_duration field, but Gravity Forms doesn’t natively allow dynamic intervals in the subscription Product Field.
My questions:
-
Is it possible to dynamically set the subscription interval based on a CPT field in Gravity Forms?
-
Do I need to use custom hooks (gform_pre_submission_filter, gform_stripe_subscription_args) to adjust the Stripe subscription before submission?
-
Are there any best practices or examples for handling 1-year vs 2-year subscription intervals dynamically in Gravity Forms?
Any guidance, snippets, or examples would be greatly appreciated!