Skip to Content Skip to Menu

Get option value from plan and insert in to field

  • wintercorn
  • wintercorn
  • ONLINE
  • Posts: 193
  • Thanks: 20
  • Karma: 2
1 hour 42 minutes ago #343342 by wintercorn
In the desire to simplify the registration process I've now created a single plan with options rather than four different plans. Problem is that the Sub just shows as 'Membership' which is the plan name.

How can I get the various options and insert them in to a field which I can then use to filter lists, display on the profile etc?

In CBSUBS the option is shown as {"planoptions":{"subscription-level":["associate"]}}.

Also, my plan is to simply edit each user sub to change the plan and edit the option value.  If I then update existing subs to this new plan with options will the renewal process correctly?

Thanks
 
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50171
  • Thanks: 8587
  • Karma: 1469
1 hour 35 minutes ago #343345 by krileon

How can I get the various options and insert them in to a field which I can then use to filter lists, display on the profile etc?

CBSubs Options enables new substitutions for you to use to do this. You can use CBSubs Fields to push their selection into a CB Field or you can have your userlist query filter on the JSON data, whichever works for you. You'll find instructions for the CBSubs Options substitutions under Integrations > Options > Display tab of your plan.

Also, my plan is to simply edit each user sub to change the plan and edit the option value. If I then update existing subs to this new plan with options will the renewal process correctly?

Option selection can be changed at renewal and yes it will adjust the price accordingly and update the option values stored in the subscription JSON.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • wintercorn
  • wintercorn
  • ONLINE
  • Posts: 193
  • Thanks: 20
  • Karma: 2
1 hour 9 minutes ago #343346 by wintercorn
Replied by wintercorn on topic Get option value from plan and insert in to field
I assume it's this bit but I don't follow.

The following additional substitutions will also be supported:
User Subscription substitutions
[PLAN_OPTS_OPTION_{OPTION_NAME}] displays the Value parameter of {OPTION_NAME} option (e.g. {OPTION_NAME} of 1-yr as [PLAN_OPTS_OPTION_1-YR] outputting opt_1)
Payment substitutions
The following are only available if a payment basket is available at the time of substitutions parsing: [PLAN_{PLAN_ID}_OPTS_OPTION_{OPTION_NAME}] displays the Value parameter of {OPTION_NAME} option from a specific plan (e.g. {OPTION_NAME} of 1-yr as [PLAN_1_OPTS_OPTION_1-YR] outputting opt_1)


How does this get the option value?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50171
  • Thanks: 8587
  • Karma: 1469
49 minutes ago #343347 by krileon
It gets the value they selected from your option. It's effectively no different from a [FIELD_NAME] substitution. An example is already provided with a option that has a name of "1-yr". In your case your option has a name of "subscription-level" so the substitution is [PLAN_OPTS_OPTION_SUBSCRIPTION-LEVEL]. You can use this in CBSubs Fields to pass the value off to a field. Example as follows.

Field: cb_subscriptionlevel
Operator: Set: Field = Value
Value: [PLAN_OPTS_OPTION_SUBSCRIPTION-LEVEL]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum