×

Error

Please login first

CBSUBS - Exclude users of a specific plan from use

12 years 8 months ago #174225 by jpapan
Is it possible to exclude users who have subscribed to a plan from a user list without hardcoding?

Please Log in to join the conversation.

12 years 8 months ago #174227 by krileon
Yes, using a filter on your userlist. Please see the below example.

Display only if subscribed:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS subs WHERE subs.`user_id` = ue.`id` AND subs.`plan_id` = PLAN_ID_HERE AND subs.`status` = 'A' ) > 0 )


Display only if NOT subscribed:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS subs WHERE subs.`user_id` = ue.`id` AND subs.`plan_id` = PLAN_ID_HERE AND subs.`status` = 'A' ) = 0 )

With the above replace PLAN_ID_HERE with the actual plans ID you want to filter by.


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

Please Log in to join the conversation.

12 years 4 months ago - 12 years 4 months ago #186998 by reders
Hi there,
I have applied this fix and it is giving me an error in the front end, can you tell me if I have done it correctly?

Please see my attached screen shot.

Regards,
Sean R.

Please Log in to join the conversation.

12 years 4 months ago #187005 by krileon
It's an Advanced filter. Please select "Advanced", delete all of its contents, then copy/paste and adjust the query provided above.


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.

Moderators: beatnantkrileon
Time to create page: 0.221 seconds

Facebook Twitter LinkedIn