[#5963] CBSubs info in a CB Field

7 years 2 months ago - 7 years 2 months ago #290146 by AlanJones
[#5963] CBSubs info in a CB Field was created by AlanJones
We have an unusual issue.

We need to be able to populate fields with 2 obscure CBSubs database fields.

1. We need the month of subscription expiration for active members (not the year, just the month).
2. We need the $ amount of their subscription in a single field.

The reason why we need these items separated is that we are using an Excel download tool and the admins need to isolate active members by their expiration month, and they need to see the $ amount of the subscription in a separate field.

Any ideas? Could we use the Query field tool for this?

J - 3.6.5
CB - 2.1.0
Subs - 4.1.0

Own Your Own Community!

Please Log in to join the conversation.

7 years 2 months ago #290220 by krileon
Replied by krileon on topic CBSubs info in a CB Field
CB Query Field can certainly grab those values from the _cbsubs_subscriptions database (note how much they paid is in _cbsubs_baskets tied to the basket which is tied to the subscription), but if whatever tool you're using to turn this into excel depends on the value being in _comprofiler it won't work as query fields don't store anything. You can substitute in CBSubs information regarding a users subscription using the below.

[cbsubs:subscriptions plan="PLAN_ID_HERE" output="price" /]

For price you'd have to just grab that information about the plan it self using the below.

[cbsubs:plans plan="PLAN_ID_HERE" output="expiry_date" /]

This only works for locations that content prepare usage is enabled though. So it'd work in Custom HTML fields, etc.. You could combine this with CB Auto Actions and a Field action to set the value of a field to the values you're needing, but be sure to enable content prepare for the action under parameters.


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

Please Log in to join the conversation.

7 years 2 months ago #290263 by AlanJones
Replied by AlanJones on topic CBSubs info in a CB Field
Thanks! We're going to try make this work.

Own Your Own Community!

Please Log in to join the conversation.

7 years 2 months ago #290352 by AlanJones
Replied by AlanJones on topic CBSubs info in a CB Field
OK, so we are battling to make this work . I feel like we're really close.

We created an AutoAction that populates a searchable field. We can get it to work fine for simple cb info like date and user ID...
But the string you gave us does not produce a result. It just displays the string back to us.

Attached is an image using with [user_id]:
And another using [cbsubs:subscriptions plan="PLAN_ID_HERE" output="price" /]

Any ideas? Maybe there is a switch we need on is CBSubs to enable this kind of integration?

Own Your Own Community!
Attachments:

Please Log in to join the conversation.

7 years 2 months ago - 7 years 2 months ago #290392 by krileon
Replied by krileon on topic CBSubs info in a CB Field
You need to enable content prepare and ensure you've the latest CB and CBSubs installed. To enable content prepare ensure within your auto action under Parameters that "Content Plugins" is set to "Yes". Note you will need to trigger the action again as the value you're seeing is already stored. You also need to replace PLAN_ID_HERE with of course the plan id you're wanting to check for.


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 to join the conversation.

7 years 2 months ago #290402 by AlanJones
Replied by AlanJones on topic CBSubs info in a CB Field
OK, progress. It's reading the string now, but not displaying anything. Is there somewhere where I can see all the CBSubs - Substitutions?

Own Your Own Community!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.225 seconds

Facebook Twitter LinkedIn