[SOLVED] CBSubs Integrations on Renewal

2 years 3 months ago - 2 years 3 months ago #327921 by bizguy
In CBSubs plans I use CBFields to set a number of field values on plan activation and deactivation.

Specifically, I set cb_role_assign = 0 which is for general members, removed on deactivation.

Some accounts are manually set to a custom role level: cb_role_assign = 2

Does renewing a plan, trigger the activation/deactivation actions? Some admins are reporting they no longer have their role access.

If so, is there a workaround?

Ed

Please Log in to join the conversation.

2 years 3 months ago #327926 by krileon
Replied by krileon on topic CBSubs Integrations on Renewal

Does renewing a plan, trigger the activation/deactivation actions?

A renewal triggers the activation, yes. So if they renew and it's configured to set a fields value it will override whatever you have set manually.

If so, is there a workaround?

It's doing as it's supposed to so not really. Only way would probably be to just use CB Auto Actions for this and add a condition to ignore setting the fields value if it's equal to 2. You might be able to use the below usage as well in CBSubs Fields integration to just leave it as 2 if set to 2.

[cb:if cb_role_assign!="2"]0[cb:else]2[/cb:else][/cb:if]

If you want to replace this behavior with CB Auto Actions use the below to act on subscription state changes.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A

Be sure to replace PLAN_ID_HERE with the actual id of your plan as found in CBSubs > Plans.


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.
The following user(s) said Thank You: bizguy

Please Log in to join the conversation.

2 years 3 months ago #327964 by bizguy
Replied by bizguy on topic CBSubs Integrations on Renewal
Thanks, Kyle!

Upon reflection, I realized that I only needed to set the cb_role_assign when a new user was created. After that point, they would remain a 0 unless changed by management, so I used the following in the CBSubs Field:

[cb:if !cb_role_assign]0[/cb:if]

If my logic here is wrong, please advise.

Ed

Please Log in to join the conversation.

2 years 3 months ago #327965 by krileon
Replied by krileon on topic CBSubs Integrations on Renewal
That's an unsupported IF substitution syntax. Please read the substitution tutorial below carefully for supported syntax.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

If it's truly empty then the below should work. If it's an integer field though it will already be set to 0 as its default value and can't really be empty.

[cb:if cb_role_assign=""]0[/cb:if]


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 to join the conversation.

2 years 3 months ago #327974 by bizguy
Replied by bizguy on topic CBSubs Integrations on Renewal
Thanks for the correction.

They are text fields so I used your corrected code.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.218 seconds

Facebook Twitter LinkedIn