Display number of registrants in an article

  • lumis
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 9 months ago - 8 years 9 months ago #100712 by lumis
Hi Tuan,
My client wants to show the number of registrants in an event on the registration form and also in an article. I was trying to get the EB View module to show the event details but I'm not sure on the Query String needed.

I would also like to add it to the event header that appears above the registration form - in the "Registration Form Message (Individual)
Available Tags: [EVENT_TITLE]" - is there a tag for the number of registrants, or is there a snippet of code I could add to display the current number of registrants?

We don't use the event details page - just the registration form itself.

Thanks,
Aaron
Last edit: 8 years 9 months ago by lumis. Reason: Sorry - wrong category (event bookings)

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

More
8 years 9 months ago #100728 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display number of registrants in an article
Hello

My client wants to show the number of registrants in an event on the registration form and also in an article. I was trying to get the EB View module to show the event details but I'm not sure on the Query String needed.


=> The query string you need to use is id=ID_OF_EVENT, for example, id=1 . However, in your case, look like you want to display it dynamic base on event is being registered,so I am afraid of it is not possible

Also, there is no tag for showing number of registrants on that page. You will have to write some code to get that data. The below code should return number of registrants of that event:
Code:
$db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('SUM(number_registrants)') ->from('#__eb_registrants') ->where('event_id = '. $this->event->id) ->where('group_id = 0 AND (published = 1 OR (payment_method LIKE "os_offline%" AND published NOT IN (2,3)))'); $db->setQuery($query); $numberRegistrants = $db->loadResult();

Regards,

Tuan

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

  • lumis
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #100793 by lumis
Ok thanks Tuan :)

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

Moderators: Tuan Pham Ngoc