2

How can I fetch the number of participants(quota) who can register for an event and

the max number of participants in an event if the event has not started on the manage events

4

There is a BAO function in CiviCRM which returns the available slots for registration

CRM_Event_BAO_Participant::pendingToConfirmSpaces($eventId);

You can use api to get the max number of participant for an event

$result = civicrm_api3('Event', 'getvalue', [
  'return' => "max_participants",
  'id' => 1,
]);

To answer your question in detail, you canuse pagerun hook on event page and then get the variable assigned in smarty using $rows = $page->get_template_vars('rows'); override the variable to add or remove values and then assign it back to smarty using $page->assign('rows' $rows);

HTH

Pradeep

  • How can I use this in manage events page,since it's not a form so probably can't use hook buildform, I was looking to get the value in the $row in the template where we have variables like $row.id, $row.repeat etc,if overriding tpl adding it in custom template section is not good practice,kindly suggest a way which is recommended,I am sorry if my question is silly – harshal Jan 11 at 2:20
  • 1
    Updated the answer for your question – Pradeep Nayak Jan 11 at 5:08

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.