Getting Help with List Sorting (and Advanced sorting)

2 months 1 week ago - 2 months 1 week ago #337277 by Pomond
Hi, CB Team! Greetings from Chicago!

I'd like to construct a List from my registered users ordered by Joomla ACL or even by the type of CB Subscriptions plan they purchase. Is this possible?

My scenario is four tiers of paid CB Subscriptions (Silver, Gold, Platinum and Diamond "sponsorships"). A customer can purchase one of the tiers via CB Subs and their account gets automatically assigned to a related, tiered Joomla User Group (silver through diamond, as above).

I'd like to construct a List within Community Builder that lists all of my sponsor accounts, but orders them such that Diamond sponsor accounts are listed first (then alphabetically within), then Platinum sponsor accounts, then Gold, etc.

I see this possibility within Joomla backend > Community Builder > List Management> Edit List > Sorting. However, I don't see any predefined options for CB Subs plans within the fields available inside "Basic," and I'm not tricky enough with SQL to suss out what I might need within "Advanced" (although I suppose I could certainly start banging around).

I thought I'd ping the CB Team first: Could you offer some guidance on how I'd configure this list? (maybe some tips on what table column names to use?) Thanks much!

Please Log in to join the conversation.

2 months 1 week ago #337280 by krileon
Yes that's doable, but not with Basic sorting. You will have to use Advanced sorting and supply your own SQL. The Advanced sorting just directly adds to the database queries ORDER BY clause so keep that in mind when formatting your SQL.

I thought I'd ping the CB Team first: Could you offer some guidance on how I'd configure this list? (maybe some tips on what table column names to use?) Thanks much!

We do not provide coding assistance outside of Business memberships, which are significantly higher priced to cover what it actually costs to have someone write custom code for you. It's just constantly using an extreme amount of our time for basically free (I hope everyone understands we have not changed our prices in 5+ years despite the, saying this mildly, rough economy). Normally we only provide configuration help. So for example configuring an auto action or telling you want parameters to adjust. However raw PHP and raw SQL do not fall within that. I hope you don't feel like I'm attacking you or being hostile with this reply as I'm genuinely just trying to give a reason as to why we stopped providing custom coding help and if you do feel that way I deeply apologize as that's not my intent.

So with that said the best I can offer you is older examples we've already provided and also explanations of database structures. Below are examples of how to sort a userlist by a plan.

www.joomlapolis.com/forum/developer-members-support/244413-sort-list
www.joomlapolis.com/forum/255-developer-members-support/235683-solved-cb-list-and-advanced-sorting-with-cbsubs

Below is the table relevant to subscriptions.

_cbsubs_subscriptions

The `status` column holds their current subscription status. For active subscriptions this will be "A".
The `user_id` column holds their Joomla user id linking the subscription to a user.
The `plan_id` column holds the plan id (as seen in CBSubs > Plans) for which they are subscribed to.


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.

2 months 1 week ago #337285 by Pomond
No problem, and I understand the issue of your support levels. The examples you provided are useful and will be enough to point me in the right direction, as well as your tips. Thanks!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.183 seconds

Facebook Twitter LinkedIn