4

I have an event with a price set which allows multiple registrations on one email. It accurately counts the number of people registered against the maximum allowed. How do I get the number of "actual participants" from the API? This snippet only counts the number of registration records:

{crmAPI var="ParticipantS" entity="Participant" method="getCount" sequential="1" event_id=$event.id } Count = {$ParticipantS.count}

2

You can total up the participants by looking up the line items.

https://gist.github.com/ginkgomzd/5ca327a0711fdb586529a4936accb244

1

Probably you should check each individual Participant record for the actual number of participants and count them manually. With manually I mean you can count them with smarty code.

0

I would also check out and install the excellent Summary Fields extension from Jamie McClelland (see https://civicrm.org/extensions/summary-fields ) which among many other summaries shows counts for Events attended per contact and also see Events -> Dashboard -> Event Summary (which might be in core, or might be enabled after installing the Summary Fields extension - not sure which ).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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