Skip to Content Skip to Menu

CBSUBS - Exclude users of a specific plan from use

  • jpapan
  • jpapan
  • OFFLINE
  • Posts: 14
  • Thanks: 0
  • Karma: 0
13 years 1 month 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 or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
13 years 1 month ago #174227 by krileon
Yes, using a filter on your userlist. Please see the below example.

Display only if subscribed:
Code:
( ( 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:
Code:
( ( 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 or Create an account to join the conversation.

  • reders
  • reders
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
12 years 9 months ago - 12 years 9 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.
Last edit: 12 years 9 months ago by reders.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
12 years 9 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum