Skip to Content Skip to Menu

ACL Plan Limitation

  • fede312
  • fede312
  • OFFLINE
  • Posts: 166
  • Thanks: 28
  • Karma: 1
7 years 3 months ago - 7 years 3 months ago #296383 by fede312
Replied by fede312 on topic Education "WorkFlow" Case
Yes, that sounds reasonable, I do not mind the extra work.
Forgive me if I over explained myself.

In simple terms this is what I need.

I want the “Classroom Plan” to be the “only plan” the students have deal with,
and I want “The courses” to be “a bonus” included with each renewal.
Every time you renew the “Classroom Plan,” you will get a “New Course.”

Each course is assigned to a different “ACL group,” because the courses are made in an “Online Course Component” called “OS Campus” and every time a new “ACL group” is added a new course appears on your “Course’s Page” automatically. (this is already setup)

What is the best way to go about this?

I’m willing to pay you for your time to help me setup this.

Thanks a bunch.
Last edit: 7 years 3 months ago by fede312.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48547
  • Thanks: 8290
  • Karma: 1445
7 years 3 months ago - 7 years 3 months ago #296387 by krileon
Replied by krileon on topic Education "WorkFlow" Case

What is the best way to go about this?

CB Auto Actions will be the only way to accomplish that. You'd need to use the below.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A
3: [var7] Equal To R

That should only fire if the plan is renewed. You should be able to use [var9_regular_recurrings_used] to get the number of times the subscription has been renewed (including the new renewal). If you need previous renewals excluding the current you can use [var9_previous_recurrings_used]. Using those you should be able to condition the plan to give a new course usergroup on XYZ renewal. For that trigger var9 is the subscription object so you've access to all the columns for that row in _cbsubs_subscriptions.

I’m willing to pay you for your time to help me setup this.

We do not provide such services here, sorry.


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.
Last edit: 7 years 3 months ago by krileon.
The following user(s) said Thank You: fede312

Please Log in or Create an account to join the conversation.

  • fede312
  • fede312
  • OFFLINE
  • Posts: 166
  • Thanks: 28
  • Karma: 1
7 years 3 months ago #296390 by fede312
Replied by fede312 on topic Education "WorkFlow" Case
Ok I'll take a look at that.

Forgive my ignorance, this is probably a stupid question, but

Where do all of those variables come from?
[var2] [var3], etc.

Are they preset it variables?
if so is there a list where I can find their function?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48547
  • Thanks: 8290
  • Karma: 1445
7 years 3 months ago #296394 by krileon
Replied by krileon on topic Education "WorkFlow" Case
Those are variables passed by the trigger. Specifically for onCPayUserStateChange The variables are as follows.

Code:
/** * Called at each change of user subscription state due to a plan activation or deactivation * * @param UserTable $user * @param string $status * @param int $planId * @param int $replacedPlanId * @param ParamsInterface $integrationParams * @param string $cause 'PaidSubscription' (first activation only), 'SubscriptionActivated' (renewals, cancellation reversals), 'SubscriptionDeactivated', 'Denied' * @param string $reason 'N' new subscription, 'R' renewal, 'U'=update ) * @param int $now Unix time * @param cbpaidSomething $subscription Subscription/Donation/Merchandise record * @param int $autorenewed 0: not auto-renewing (manually renewed), 1: automatically renewed (if $reason == 'R') */ public function onCPayUserStateChange( &$user, $status, $planId, $replacedPlanId, &$integrationParams, $cause, $reason, $now, &$subscription, $autorenewed );

See the below for list of triggers and their variables (note this gradually goes out of date, but I try to update it as often as possible).

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers


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

Please Log in or Create an account to join the conversation.

  • fede312
  • fede312
  • OFFLINE
  • Posts: 166
  • Thanks: 28
  • Karma: 1
7 years 3 months ago #296395 by fede312
Replied by fede312 on topic Education "WorkFlow" Case
Awesome!

Please Log in or Create an account to join the conversation.

  • fede312
  • fede312
  • OFFLINE
  • Posts: 166
  • Thanks: 28
  • Karma: 1
7 years 3 months ago #296403 by fede312
Replied by fede312 on topic Testing the CBActions on SBsubs
With the list of variables you've sent, now it all makes sense.

What is the best way to test if these CBSubs variables work correctly?

I have paypal sandbox to make the initial purchase that will trigger the Activation of a plan.
How do I make the subscription to expire to test the CB Actions on expiration?
How do make the auto renewal to happen so I can check the CB actions on auto renewal?
and same with manual renewal.

Is there a way to make these happen in the back end?

Thanks again! :)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum