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