Home › Forums › Ticket Products › Event Tickets Plus › Tickets remaining counts not correct
- This topic has 5 replies, 2 voices, and was last updated 6 years, 8 months ago by bruce williams.
-
AuthorPosts
-
July 20, 2017 at 7:59 am #1323835bruce williamsParticipant
Our events normally include 3 different tickets: an “early bird” ticket, a “general” ticket and a “discounted” ticket. We set a global inventory for our events and each ticket is then set to respect the global inventory.
On the ticket section of the event, each ticket then shows the number available as the global inventory. For example, if I set a global inventory of 20, each of the 3 different tickets shows 20 tickets available.
This implies that there are 3x the global inventory of tickets available which is misleading.
Is it possible to have an OVERALL statement of tickets remaining above the list of tickets rather than an individual statement of tickets remaining for each ticket? Of course, if a ticket was set to have an independent stock level or global stock but cap sales, this would require that limit to be stated alongside the individual ticket as is done currently.
Thanks!
July 24, 2017 at 7:39 am #1325301JenniferKeymasterHi Bruce,
Thanks for reaching out!
The counts are actually showing as intended, although I see where you are coming from. I do want to point out that if a user goes to add any of the tickets, the count for each of the others decrease (see screenshot).
It would be possible to just display the global count above all of the other tickets, but this would involve a code customization. To do this, you can follow these instructions to copy the template found at wp-content/plugins/event-tickets-plus/src/views/wootickets/tickets.php into your child theme. From there, you can add in a condition to check if the ticket is set to use global stock by changing this block:
if ( $remaining ) {
?>
ID ) . '">' . esc_html( $remaining ) . ''
);
?>
to this:
if ( $remaining && Tribe__Tickets__Global_Stock::CAPPED_STOCK_MODE === $ticket->global_stock_mode() || Tribe__Tickets__Global_Stock::OWN_STOCK_MODE === $ticket->global_stock_mode() ) {
?>
ID ) . '">' . esc_html( $remaining ) . ''
);
?>
You can display an overall count by adding the following to that file, wherever you'd like the count to display:
For example, if you'd like it to display under the "Tickets" heading, you can add it after line 41:
Let me know how that works!
Thanks,
Jennifer
July 24, 2017 at 8:10 am #1325330bruce williamsParticipantCouldn’t this be solved by doing essentially what is done on the back-end? Specifically, include text like:
“X available of global stock Y”
on the front-end when multiple tickets are defined having a global stock level.
The advantage of this method is that you can easily address the cases where there are tickets with both global stock and individual stock for a single event (a scenario which is allowed for in the back-end ticket configuration).
July 26, 2017 at 9:58 am #1326458JenniferKeymasterSure, you could do something like:
if ( $remaining ) {
?>
<span class="tribe-tickets-remaining">
<?php
if ( Tribe__Tickets__Global_Stock::GLOBAL_STOCK_MODE !== $ticket->global_stock_mode() ) {
echo sprintf( esc_html__( '%1$s available', 'event-tickets-plus' ),
'<span class="available-stock" data-product-id="' . esc_attr( $ticket->ID ) . '">' . esc_html( $remaining ) . '</span>'
);
} else {
$global_stock_level = tribe_get_event_meta();
$global_stock_level = $global_stock_level['_tribe_ticket_global_stock_level'][0];echo sprintf( esc_html__( '%1$s available', 'event-tickets-plus' ),
'<span class="available-stock" data-product-id="' . esc_attr( $ticket->ID ) . '">' . esc_html( $remaining ) . " of global stock $global_stock_level" . '</span>'
);
}
?>
</span>
<?php
}This will leave the independent and global but capped ticket counts displaying as they do currently but adjusts the display for global tickets (see screenshot). Note that the global stock decreases as tickets are purchased (it was originally 30, and I bought 3 tickets, which is why you see “27). You could make an adjustment to $global_stock_level (which currently pulls the current global stock from the event meta data) if you would like to change this.
Per our forum guidelines we are limited in the amount of support we can provide for customizations, but this should at least provide a starting point for you.
Please let me know if you have any questions!
Thanks,
Jennifer
August 17, 2017 at 9:35 am #1336859Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Tickets remaining counts not correct’ is closed to new replies.