[SOLVED] CB Subs and K2

9 years 6 months ago - 9 years 6 months ago #250673 by andrew432
[SOLVED] CB Subs and K2 was created by andrew432
I need to add and remove users from a K2 user group with CB Subs, what's the best way to accomplish this?

Regards,
Andrew

CB 2.0.0, CB Subs 4.0.0-rc.1 on Joomla!3.3.6.

Please Log in to join the conversation.

9 years 6 months ago #250688 by nant
Replied by nant on topic CB Subs and K2

andrew432 wrote: I need to add and remove users from a K2 user group with CB Subs, what's the best way to accomplish this?

Regards,
Andrew

CB 2.0.0, CB Subs 4.0.0-rc.1 on Joomla!3.3.6.


CBSubs SQL action should work - you just have to figure out the K2 database table that needs updating.

Please Log in to join the conversation.

9 years 6 months ago #250698 by andrew432
Replied by andrew432 on topic CB Subs and K2
Thanks, I've just installed SQL actions.

In the table kjltk_k2_users the field named "group" needs to be set to 2 upon subscribe, and set to 1 upon unsubscribe, or expiration.

I can't find an example of how this is done, or the correct syntax to use in the SQL Action and would appreciate it if you could please tell me, or point me in the right direction.

Regards,
Andrew

Please Log in to join the conversation.

9 years 6 months ago #250703 by nant
Replied by nant on topic CB Subs and K2

andrew432 wrote: Thanks, I've just installed SQL actions.

In the table kjltk_k2_users the field named "group" needs to be set to 2 upon subscribe, and set to 1 upon unsubscribe, or expiration.

I can't find an example of how this is done, or the correct syntax to use in the SQL Action and would appreciate it if you could please tell me, or point me in the right direction.

Regards,
Andrew


There are some examples here:

www.joomlapolis.com/forum/90-sql-actions

You should test your SQL scripts first using Myphpadmin on your test database.

Sorry, I have no K2 installation so I cannot offer further help - nor do I know if this K2 group column takes an integer a string or a list of strings - you need to investigate this.
The following user(s) said Thank You: andrew432

Please Log in to join the conversation.

9 years 6 months ago #250713 by krileon
Replied by krileon on topic CB Subs and K2
You could use CB Auto Actions an its K2 action to synchronize a user to a different usergroup. You'd use the below action configuration to act on CBSubs events.

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


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

Please Log in to join the conversation.

9 years 6 months ago #250718 by nant
Replied by nant on topic CB Subs and K2
Yup - Kyle's method is better and painless ;-)
The following user(s) said Thank You: andrew432

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.292 seconds

Facebook Twitter LinkedIn