Joomla! 3.9.18
CB 2.4.5+build.2020.05.07.21.35.06.e8f8a6125 (latest version)
CB Auto Actions 8.0.0+build.2020.04.17.17.38.41.bcf774668 (latest version)
CBSubs 4.4.0
Simplifying things, we have two types of membership subscription – Full Membership Plan and Restricted Membership Plan. Both Plans are exclusive and are parented to Top.
We also have two user groups – Full Access and Restricted Access. Both user groups are parented to Registered.
All members initially subscribe to the Full Membership Plan and are put automatically into the Full Access user group, which is the User Group specified in the Plan’s Access tab.
For the Restricted Membership Plan the User Group specified in the Plan’s Access tab is Restricted Access.
When the Full Membership expires we sometimes want to move the member to the Restricted Membership Plan. Note that this is always done after expiry, and always in the back end.
Instead of reactivating the Full Membership we ‘upgrade’ to the Restricted Membership. So far, so good. However:
• not only is the member placed into the Restricted Access user group but the original Full Access user group remains unchanged.
• The member’s previous expired Full Membership is not shown in the Subscriptions list as having been upgraded (Replaced By Subscription is empty) nor is his current active subscription shown as being an upgrade (Replaces Subscription is empty). This does sort of make sense, as the original subscription period has ended, but it’s a reactivation not a new subscription.
If we reactivate the previous Full Membership and immediately ‘upgrade’ to the Restricted Membership then the Replaces/Replaced By values appear correctly, but the user group is still wrong.
I have tried to set up a CB Auto Action to remove the unwanted user group but it’s not working so I’m obviously doing something wrong. It’s set up as:
Triggers: onCPayUserStateChange
Type: Usergroup
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To RESTRICTED_MEMBERSHIP_PLAN_ID
Conditional 2: [var2] Equal To A (should that be in quotes?)
Action 1:
Mode: Remove usergroups
Usergroup: Full Access
Action 2:
Mode: Add usergroups
Usergroup: Restricted Access
I need to sort the user group problem out since if the member reverts to a Full Membership the allocation to the Restricted Access user group remains set.