Displaying Event Participant Data

In the B2Bsellers Suite, event participant registrations are stored as extensions on the order line items. This allows you to access specific details, such as the participant's name, the event title, and the location, directly within your templates.

Data Access via Twig

Each line item that represents an event registration contains an eventParticipant extension. You can use the following snippet to safely output this data in your storefront or email templates.

Example

{# Check if the line item contains participant data #}
{% if nestedItem.extensions.eventParticipant is defined %}
    {% set eventParticipant = nestedItem.extensions.eventParticipant %}

    <div class="event-participant-details">
        <strong>Participant:</strong> {{ eventParticipant.firstName }} {{ eventParticipant.lastName }}<br />
        <strong>Email:</strong> {{ eventParticipant.email }}<br />

        {# Access nested event details if available #}
        {% if eventParticipant.event is defined %}
            <strong>Event:</strong> {{ eventParticipant.event.translated.name }}<br />
            <strong>Date:</strong> 
            {{ eventParticipant.event.startDate|format_date('short', locale='en-GB') }} - 
            {{ eventParticipant.event.endDate|format_date('short', locale='en-GB') }}<br />

            {% if eventParticipant.event.eventLocation is defined %}
                <strong>Location:</strong> {{ eventParticipant.event.eventLocation.translated.name }}
            {% endif %}
        {% endif %}
    </div>
{% endif %}

Key Data Points

  • Participant Identity: Access basic contact info via firstName, lastName, and email.

  • Event Metadata: Retrieve the translated event name and scheduled dates.

  • Location Context: If a location is assigned to the event, it is accessible via the eventLocation association.

Last updated

Was this helpful?