Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/945cd05eb792c74481b4 to your computer and use it in GitHub Desktop.
Save joshfeck/945cd05eb792c74481b4 to your computer and use it in GitHub Desktop.
loop through each attendee and build ticket links. EE3 + Multi Event Registration (aka mer)
<?php
$sql = "SELECT id FROM " . EVENTS_ATTENDEE_TABLE . " WHERE attendee_session = %s";
$attendees = $wpdb->get_col( $wpdb->prepare( $sql, $payment_data['attendee_session'] ));
foreach ($attendees as $attendee_id) {
?>
<tr>
<td><?php _e('Ticket Link: ','event_espresso');
echo espresso_ticket_links($registration_id, $attendee_id); ?>
</td>
</tr>
<?php }
?>
<?php
//same thing, + the ticket type
$sql = "SELECT id, price_option FROM " . EVENTS_ATTENDEE_TABLE . " WHERE attendee_session = %s";
$attendees = $wpdb->get_results( $wpdb->prepare( $sql, $payment_data['attendee_session'] ));
foreach ($attendees as $attendee_id) {
?>
<table>
<tr>
<td>Ticket Link:</td>
<td><?php echo espresso_ticket_links($registration_id, $attendee_id->id); ?></td>
</tr>
<tr>
<td>Ticket Type: </td>
<td><?php echo $attendee_id->price_option; ?></td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment