Conditional Code based on Membership Level

11 years 4 weeks ago #101698 by undoIT
I'm looking into the CB Subscriptions Plugin. Is it possible to use a conditional statement to display code based on a members level. For example, let's say I wanted to put a message in a module or in a component that is not supported by the plugins. If the user is a visitor they wouldn't see anything. If there were logged in as a "Gold Member" they would see this message: "I am a gold member". If they were logged in as a "Silver Member" They would see this message "I am a silver member".

Can this be accomplished with a PHP conditional statement?

Please Log in to join the conversation.

11 years 4 weeks ago #101705 by krileon
Replied by krileon on topic Re:Conditional Code based on Membership Level
I do not believe you can control aspects of plugins, components, etc.. at a coding level without altering the code to do checks for the subscription.

However you can control access to modules, components, etc.. You could display a module for XYZ plan then a module for ABC plan.


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.

11 years 4 weeks ago #101723 by nant
undoIT wrote:

I'm looking into the CB Subscriptions Plugin. Is it possible to use a conditional statement to display code based on a members level. For example, let's say I wanted to put a message in a module or in a component that is not supported by the plugins. If the user is a visitor they wouldn't see anything. If there were logged in as a "Gold Member" they would see this message: "I am a gold member". If they were logged in as a "Silver Member" They would see this message "I am a silver member".

Can this be accomplished with a PHP conditional statement?


Hmmm, you can set a value of a CB field based on subscribed plan.

You can also use a delimiter field that modifies itself based on this CB field value.

And I believe that you can place this delimiter field in the CB content module.

Please Log in to join the conversation.

11 years 3 weeks ago #101783 by undoIT
I would need something that could be placed in Sobi2.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.412 seconds

Facebook Twitter LinkedIn