WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Booking Table Code Change Request (5 posts)

  1. ngkokkee
    Member
    Posted 1 year ago #

    Hi,

    I have made some modifications to em-bookings-table.php to help me display and export the bookings in individual ticket type level (i.e. 1 user may make multiple ticket types for 1 event)

    http://wordpress.org/support/topic/display-and-export-individual-ticket-types-in-manage-bookings?replies=4

    There is a function that I have to keep patching because the original code doesn't work correctly.

    Could you update output_table() to fix the code in

    if( $this->show_tickets ){
    }

    Add code to print additional </tr><tr> for rows after the first row. This is my ugly patch if you want to have a reference

    if( $this->show_tickets ){
        <strong>$loopcount = 0;</strong>
        foreach($EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking){
            <strong>$loopcount++;
    	if ($loopcount > 0) {
                echo '</tr><tr>';
            }</strong>
            ?><td><?php echo implode('</td><td>', $this->get_row($EM_Ticket_Booking)); ?></td><?php
        }
    } else {

    Regards
    Kok Kee

    http://wordpress.org/extend/plugins/events-manager/

  2. ngkokkee
    Member
    Posted 1 year ago #

    Took out the strong emphasis since it doesn't show up in the code block.

    if( $this->show_tickets ){
        $loopcount = 0;
        foreach($EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking){
            $loopcount++;
    	if ($loopcount > 0) {
                echo '</tr><tr>';
            }
            ?><td><?php echo implode('</td><td>', $this->get_row($EM_Ticket_Booking)); ?></td><?php
        }
    } else {
  3. agelonwl
    Member
    Posted 1 year ago #

    thanks, we will going to check this out however can I know what do you mean by "the original code doesn't work correctly." ? seems to be working fine on my test site.

  4. ngkokkee
    Member
    Posted 1 year ago #

    If you have multiple ticket types in one booking, the tickets will be printed out sequentially in one single row.

    <ticket 1><ticket 2><ticket 3>

    instead of

    <ticket 1>
    <ticket 2>
    <ticket 3>

    Just allow multiple ticket types and set the show_tickets flag to true in the class constructor and you will see this effect. The code prints </tr><tr> to break them into rows.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    problem with the above is that it ruins the flow of pagination.

    interesting idea though... when we do revamp that table will think of ways to use this (e.g. as an expanded view or something)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic