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.
-
AuthorPosts
-
April 23, 2016 at 8:16 am #1106272John PaulParticipant
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 = ‘- ‘;
- <normal>%s</normal> places remaining: %s
foreach ( $ticket_ids as $ticket_id ) {
$ticket = $Woo__Tickets->get_ticket( $post_id, $ticket_id );
$html .= sprintf( ‘‘, $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
April 25, 2016 at 11:37 am #1106748JoshParticipantHey 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!
April 25, 2016 at 12:14 pm #1106763John PaulParticipantmany thanks… really appreciate it !!
April 26, 2016 at 8:52 am #1107124JoshParticipantHey 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!
-
AuthorPosts
- The topic ‘Upgrade to event tickets plus and places remaining’ is closed to new replies.