• Resolved Ghostyvb13

    (@ghostyvb13)


    For our cooking club we use your plugin so our member can enroll for a specific cooking night. As an extra field we have added a txt field called Introduction, which means extra new people that might attend that night.

    In the attendees overview only the first and last name is shown, is it possible to also add this field on the frontend. We can view the variable using the backend but getting this information on the frontend is also needed.

    Hopefully you might have a solution for us, please let us know ??

    Kind Regards,

    Vincent

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author roundupwp

    (@roundupwp)

    Hey Vincent,

    I do! Though you may need a moderate amount of comfort with PHP. Take a look at this article:

    https://roundupwp.com/codex/action-rtec_the_attendee_list/

    If you have trouble, send me a link to an event that has the registration form on it and I can help you add the additional field.

    Thanks!

    – Craig

    Thread Starter Ghostyvb13

    (@ghostyvb13)

    That worked very sweet.. I created some extra custom code also because i needed to count the totals of the custom1 field and the total members + the custom field. And it worked out nice

    Here’s the code for someone that would need some help:

    <?php
    /*
    === Load parent Styles ===
    */
    function dc_enqueue_styles() {
    wp_enqueue_style( ‘divi-parent’, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( ‘divi-parent’ ) );
    }
    add_action( ‘wp_enqueue_scripts’, ‘dc_enqueue_styles’ );

    function ru_custom_attendee_list( $registrants_data ) {

    $totals = 0;

    $html = ‘<div class=”tribe-events-event-meta rtec-event-meta rtec-attendee-list-meta”>’;
    $html .= ‘<h3 class=”rtec-section-title”>Aangemeld</h3>’;
    $html .= ‘<div style=”padding: 0 4%”>’;

    $html .= ‘<table width=””>’;
    $html .= ‘<thead>’;
    $html .= ‘<tr>’;
    $html .= ‘<th>Naam</th>’;
    $html .= ‘<th>Achternaam</th>’;
    $html .= ‘<th>Introducees</th>’;
    $html .= ‘</tr>’;
    $html .= ‘</thead>’;
    $html .= ‘<tbody>’;

    // loops through the $registrants_data and displays the values in their array order
    foreach ( $registrants_data as $registration ) {
    $html .= ‘<tr>’;

    $totals += $registration[“custom1”];
    $totals2 += $registration[“custom1″];

    foreach ( $registration as $key => $value ) {
    $html .= ‘<td valign=”top”>’ . esc_html( $value ) . ‘</td>’;
    }

    $totals2 += 1;

    $html .= ‘</tr>’;
    }
    $html .= ‘<tr><td colspan=2>Totaal introducees</td><td>’. $totals .'</td></tr>’;
    $html .= ‘<tr><td colspan=2>Totaal deelnemers</td><td>’. $totals2 .'</td></tr>’;
    $html .= ‘</tbody>’;
    $html .= ‘</table>’;

    $html .= ‘</div>’;
    $html .= ‘</div>’;

    echo $html;

    }
    // removes the default attendee list, otherwise you will have two lists
    remove_action( ‘rtec_the_attendee_list’, ‘rtec_the_default_attendee_list’ );
    add_action( ‘rtec_the_attendee_list’, ‘ru_custom_attendee_list’ );

    function ru_attendee_list_settings_filter( $attendee_list_fields ) {

    // adds custom field data to the $registrants_data for the custom attendee list
    $attendee_list_fields = array( ‘first_name’, ‘last_name’, ‘custom1’ );

    return $attendee_list_fields;
    }
    add_filter( ‘rtec_attendee_list_fields’, ‘ru_attendee_list_settings_filter’, 10, 1 );

    Plugin Author roundupwp

    (@roundupwp)

    Glad that helped! Thanks for including the code as well. It may help others.

    Have a great start to your week!

    – Craig

    Hello there,

    I’m pretty new to developpement but I absolutely need to add an extra field to the attendee list of this amazing plugin ??

    I’ve read everything but I can’t find this function : rtec_the_attendee_list

    What is the file to modify ?

    I just need to add the “other” field to the attendee list ??

    Many thanks !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra registration field in attendees list’ is closed to new replies.