• Resolved wpshop

    (@wpshop)


    In Events List we have Attendees column with total sold tickets. The amount includes the deleted attendees, but i want to show amount without them.
    function render_tickets_entry in \event-tickets\src\Tribe\Admin\Columns\Tickets.php
    render this column.
    this code solve the problem, is it possible do it without plugin changing?

    protected function render_tickets_entry( $post_id ) {
     $post = get_post( $post_id );
     $totals = tribe( 'tickets.handler' )->get_post_totals( $post );
     // Bail with —
     if ( 0 === $totals['tickets'] ) {
      return '—';
     }
     
     $result_totals = (int)$totals['sold'] - absint( get_post_meta( $post_id, 
     Tribe__Tickets__Attendance::DELETED_ATTENDEES_COUNT, true ) );
    
     $content = sprintf( '<div>%s</div>%s', $result_totals, $this->get_percentage_string( $post->ID ) ); 
     
    $attendees_link = tribe( 'tickets.attendees' )->get_report_link( $post );
    
    return sprintf( '<a href="%s" target="_blank" class="tribe-tickets-column-attendees-link">%s</a>', $attendees_link, $content );
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey there @wpshop!

    Thanks for reaching out.

    Unfortunately, plugin customization is not something that we support. If one were to attempt it, I’d suggest looking over our Functions list.

    Take care,
    Ed 🙂

    Hey there,

    Since this thread has been inactive for a while, I’m going to go ahead and mark it as resolved. Don’t hesitate to create a new thread any time you help again!

    Ed 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to show total sold tickets without deleted’ is closed to new replies.