CB subs AND user_usergroup_map ...

10 years 3 days ago - 10 years 3 days ago #244006 by blump
CB subs AND user_usergroup_map ... was created by blump
Hello,

CB_SUBS : 3.0.0 .
Joomla : 2.5.16
CB : 1.9.1

I have a problem with cbsubs . I wish I could add to my group_id user when the subscription expires or when during the deactivation
I create an action SQL INSERT IGNORE INTO ` # __user_usergroup_map ` (` user_id `, ` group_id `) VALUES ( [ user_id ] , 18) ;

I also tried with URL action.

But it does not work . Updating my database during the operation, I can see that the group 18 is added in usergroup_map well for my user but at the end of the operation the groups are deleted and I can not see that the default group ' REGISTERED .

CB_subs must reset the groups at the end of the operation .. How can do we bypass this problem?

I want my subscriber pass ' Registered , Premium' ( when it works well it subscribes both groups) , to ' Registered , Expired ' upon expiration or deactivation .

This allows me to display different pages depending on the group .

For persons registered subscriber but not , they will remain under Registered .

Otherwise ' my solution is to insert into table with the user_id and group_id with SQL_ACTION and create a cron that would canner this table and add the group_id in usergroup_map . Except that it bothers me because for at least 1 min , the user will not have the right group ...

Do you have a solution ? Why CB_subs not only remove the group chooses Subscribers in User access level settings
but it resets everything to add the default group ' Registered ?

Please Log in to join the conversation.

10 years 3 days ago #244039 by nant
Replied by nant on topic CB subs AND user_usergroup_map ...
I would avoid manipulating the database for this.

Better approach would be to use CB Auto Actions to do this ans it has such an action type.
The following user(s) said Thank You: blump

Please Log in to join the conversation.

10 years 2 days ago #244060 by blump
Replied by blump on topic CB subs AND user_usergroup_map ...
ok, my system works perfectly, but we have taken a professional license for CB AUTO SHARES it would save me a lot of time. We will test. Thank you for that.
The following user(s) said Thank You: nant

Please Log in to join the conversation.

10 years 2 days ago #244079 by krileon
Replied by krileon on topic CB subs AND user_usergroup_map ...
This is best done using CB Auto Actions and its Usergroup action as suggested by nick. You'll need the below to configure the trigger and conditional as needed.

Plan Active
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To A

Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To X

With the above you can create 2 actions. 1 to adjust usergroups when PLAN_ID_HERE becomes active and another to adjust usergroups when PLAN_ID_HERE expires. Note you need to replace PLAN_ID_HERE with the actual ID of your plan.


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: blump

Please Log in to join the conversation.

10 years 2 days ago #244081 by blump
Replied by blump on topic CB subs AND user_usergroup_map ...
Thx Krileon . By cons I have not yet understood the system variables [var1] [var2], etc ... I have not had time to look into the tutorial

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.199 seconds

Facebook Twitter LinkedIn