Upgrade to event tickets plus and places remaining

Home Forums Calendar Products Events Calendar PRO Upgrade to event tickets plus and places remaining

  • This topic has 3 replies, 2 voices, and was last updated 8 years ago by Josh.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1106272
    John Paul
    Participant

    Hi. U up graded from wootickets to event tickets / pro

    I had issue due to code I had inserted in my child theme which displayed the number of tickets left for sale. I had received this code from yourselves from the site documentation.

    In the functions file I had;
    function example_displaying_stock_information() {

    $post_id = get_the_id();
    if ( Tribe__Events__Main::POSTTYPE !== get_post_type( $post_id ) ) {
    return;
    }
    $Woo__Tickets = Tribe__Events__Tickets__Woo__Main::get_instance();
    $ticket_ids = $Woo__Tickets->get_tickets_ids( $post_id );
    if ( is_array( $ticket_ids ) ) {
    $html = ‘

      ‘;
      foreach ( $ticket_ids as $ticket_id ) {
      $ticket = $Woo__Tickets->get_ticket( $post_id, $ticket_id );
      $html .= sprintf( ‘

    • <normal>%s</normal> places remaining: %s
    • ‘, $ticket->name, $ticket->stock );
      }
      $html .= ‘

    ‘;
    echo $html;
    }
    }

    the following code when inserted into the view file enable the function above to display the ticket number iformation
    <div class = “tribe-events_event_tickets_remaining”>
    <?php example_displaying_stock_information(); ?>
    </div>

    It was a critical requirement of my clients. Can you please advise what the new code should be so I can get this feature back. Many thanks..

    John

    #1106748
    Josh
    Participant

    Hey John,

    Thanks for reaching out to us!

    Try changing:

    
    $Woo__Tickets = Tribe__Events__Tickets__Woo__Main::get_instance();
    

    to:

    
    $Woo__Tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
    

    and see if that works for you now.

    Let me know if this helps.

    Thanks!

    #1106763
    John Paul
    Participant

    many thanks… really appreciate it !!

    #1107124
    Josh
    Participant

    Hey John,

    No problem! Happy to help.

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Upgrade to event tickets plus and places remaining’ is closed to new replies.