Skip to Content Skip to Menu

CBSubs options and Auto Actions

1 year 7 months ago #333267 by akasharkbow
CBSubs options and Auto Actions was created by akasharkbow
Hello all

I was very happy to find the CBSubs Options plugin today (I know I am late to the party, but still.) 

I would like to use this to offer several subscription options as follows:
value 1
value 2
value 3
(each with its own price).

I see that this value is stored in the cbsubs_subscriptions table, integrations column, as (for example) {"planoptions":{"numberfeaturedlistings":["2"]}}

I was hoping to just take the value (2) and put it in its own CB field so I can use it for other things. 

Is it possible to do this, using Auto Actions?  I think I have figured out the triggers  ([var3] = plan id; [var 2]=A for activating a new subscription) - but how would I copy the value to a new CB field? 

I hope this makes sense.  Thanks for taking the time to read.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 7 months ago #333269 by krileon
Replied by krileon on topic CBSubs options and Auto Actions
You can access the selected options using substitutions. The substitution usages are explained under the Integrations > Options > Display tab. These all should work anywhere CBSubs substitutions are processed (e.g. CBSubs Fields).

For plan pricing this is simply just [PLAN_OPTS_PRICE] and it will output the "Name" value of whatever pricing option they selected. It's a bit more complicated for price options which is
[PLAN_OPTS_OPTION_{OPTION_NAME}]. This will output the price option "Value" for "OPTION_NAME".


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.

1 year 7 months ago - 1 year 7 months ago #333278 by akasharkbow
Replied by akasharkbow on topic CBSubs options and Auto Actions
Thank you!
Last edit: 1 year 7 months ago by akasharkbow. Reason: fixed

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

1 year 6 months ago #333878 by akasharkbow
Replied by akasharkbow on topic CBSubs options and Auto Actions
I have run into a bit of a snag with this. 

This works great for me when users subscribe, or when their subscriptions expire. 

However, we run into trouble when users change their plans in CBSubs Options.  If someone changes between subscription options, then the substitution you suggested gives the value of the previous plan's options.

I have tried to achieve the substitution via the CBSubs Plan -> Integrations -> CB Fields option (first screenshot).
I also tried it using Auto Actions on cPayIntegrationAction, in case that made a difference in the order of execution etc (second screenshot).
Both options worked for subscriptions and expiries - but failed on renewals with a different option.

Looking at the change log for the user subscriptions/renewals/upgrades, I see that values are saved for both the "planoptions" and the "previousplanoptions" - both with the same variable name.  (Third screenshot).  Is it possible that the wrong value of the variable is being used in the substitution?  Or is there some way I can fix this problem?

I have attached screenshots that I hope will help to explain what I mean. 
 
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 6 months ago #333885 by krileon
Replied by krileon on topic CBSubs options and Auto Actions

However, we run into trouble when users change their plans in CBSubs Options.  If someone changes between subscription options, then the substitution you suggested gives the value of the previous plan's options.

Was able to confirm. Looks like this is just an error in the substitution through. The stored values all appear correct. Will look into this further. Probably just a caching bug.

forge.joomlapolis.com/issues/9176

I also tried it using Auto Actions on cPayIntegrationAction, in case that made a difference in the order of execution etc (second screenshot).
Both options worked for subscriptions and expiries - but failed on renewals with a different option.

These substitutions come strictly from within CBSubs so you must use a CBSubs integration for this. You won't be able to use CB Auto Actions here unless you directly access the stored params.

Looking at the change log for the user subscriptions/renewals/upgrades, I see that values are saved for both the "planoptions" and the "previousplanoptions" - both with the same variable name.  (Third screenshot).  Is it possible that the wrong value of the variable is being used in the substitution?  Or is there some way I can fix this problem?

The history looks correct. The new values are 1 for current and 2 for previous. The old values were 2 for current and 3 for previous. So that seams correct.


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.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 6 months ago #333886 by krileon
Replied by krileon on topic CBSubs options and Auto Actions
Confirmed caching problem. Have improved the substitutions so they don't need to be cached to avoid this. Fix is pending review. Once merged will release a new CBSubs build.


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