Skip to Content Skip to Menu

Not able to update field on plan expiration

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 5 months ago #294355 by liaskas
Hello

I am using the latest versions of Joomla, community builder and all of it's plugins.

Allow me to explain the situation.

My site has 2 paid membership plans but also allows registered members without any subscription at all. What differs is the abilities that each user has according to if they have paid for a plan or not.

And here comes the usecase that we can not find a solution for...

User registers. OK
After registration he has no plan assigned to his profile.

After a few days he derides to upgrade to plan A that gives him the ability to have more allowed photos in his cbGallery. On activation of the plan, the allowed photos field updates fine and everything is fine.
Example:
Field value when PLAN A is active becomes 100

So far so good...!

Now... when PLAN expires... then user becomes again a member with not any plan assigned to his profile, but we can not find any way to set the value of the field back to the desired (allowed photos field = 10)

We have tried...

1. CB fields changing on plan activation and deactivation: Works for activation but not for deactivation.

2. Auto Actions

GLOBAL...
Type: Field
User: Automatic
Access: Everybody
Triggers: OnCPayUserstatechange

CONDITIONS...
[var3] Equal to 11 (number of the plan)
[var2] Equal to X (also tried Not Equal to A)

ACTION...
Field: (the field that we want changed)
Operator: Set (Field = Value)
Value: 10

The result is that the field value does not change

Can you please advise?

Thank you in advance.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
7 years 5 months ago #294393 by krileon
Replied by krileon on topic Not able to update field on plan expiration
The below works fine for toggling behavior on plan active or deactivate states.

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

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Not Equal To A

However if you're setting the value using CBSubs Fields you should be able to reverse it as well using the below.

Field: FIELD_HERE
Operator: Set
Value: 100
Remove value on plan deactivation: Yes
Value on plan deactivation: 10


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum