Revoking Access in Family Plan

2 years 10 months ago #324974 by AlexRag
Revoking Access in Family Plan was created by AlexRag
I have set up a family plan as well as free plan on a website.

I also created two registered user groups (ACL), one for the "paid member", the other "free member" so when a member pays they get moved to paid member group.

If the primary owner of a family plan or the shared user cancels their subscription is there a way to move them to that "free member" group that I set up?

Please Log in to join the conversation.

2 years 10 months ago #324975 by krileon
Replied by krileon on topic Revoking Access in Family Plan
Cancelling the subscription should trigger a cancellation to shared users and revert any behavior applied by the plan. How are you adding the usergroups? With CB Auto Actions or within your plans under the Access tab? If using CB Auto Actions then the current triggers you're using for user subscription state won't work for shared users. You'll have to use the new triggers familyplans_onAfterAcceptSharedSub and familyplans_onAfterDeleteSharedSub for when a shared subscription is accepted or cancelled/deleted. Their variables are as follows.

familyplans_onAfterAcceptSharedSub
$_PLUGINS->trigger( 'familyplans_onAfterAcceptSharedSub', array( $this, $user, $subscription ) );

familyplans_onAfterDeleteSharedSub
$_PLUGINS->trigger( 'familyplans_onAfterDeleteSharedSub', array( $this, $user, $subscription ) );


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 10 months ago - 2 years 10 months ago #324976 by AlexRag
Replied by AlexRag on topic Revoking Access in Family Plan
I have set up what user group the plan puts them in the Access Tab

Subscribers User access level settings > User Group

Come to think of it, if the family plan expires I would also like that primary user to be moved to that "free plan" user group rather than just "Registered"

I also have another (non-family) plan that is set up the same way.

The way I setup the user group is

-Registered
--Free Member
--Pad Member

I'm not sure how to move them to another group upon expiration.

Also, to confirm, when a membership is shared that user would adopt the family plans setting (ie. they to would be added to the correct user group set up by the family)?

Please Log in to join the conversation.

2 years 10 months ago - 2 years 10 months ago #324977 by krileon
Replied by krileon on topic Revoking Access in Family Plan
The Access tab usage can only give and revoke that usergroup. It cannot give them any other usergroups. So it can't go from Usergroup 1 to Usergroup 2 then back to Usergroup 1 unless they already had Usergroup 1 or a plan they transitioned to is controlling Usergroup 1 since CBSubs won't touch usergroups it is not configured to control.

For greater control over usergroup assignment based off plan subscription status you need to use CB Auto Actions. The CBSubs Family Plans integration will try to propagate those subscription status changes to users whom the plan was shared with as well. With CB Auto Actions you can use the below usage to change usergroups.

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

This works with any action type. So in your case you'd use a Usergroup action type. This should work with shared plans as well.

Also, to confirm, when a membership is shared that user would adopt the family plans setting (ie. they to would be added to the correct user group set up by the family)?

Yes, that should be working fine.


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 10 months ago #324978 by AlexRag
Replied by AlexRag on topic Revoking Access in Family Plan
Thank you! I will give this a try!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.205 seconds

Facebook Twitter LinkedIn