Tickets remaining counts not correct

Home Forums Ticket Products Event Tickets Plus Tickets remaining counts not correct

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1323835
    bruce williams
    Participant

    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!

    #1325301
    Jennifer
    Keymaster

    Hi 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

    #1325330
    bruce williams
    Participant

    Couldn’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).

    #1326458
    Jennifer
    Keymaster

    Sure, 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

    #1336859
    Support Droid
    Keymaster

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Tickets remaining counts not correct’ is closed to new replies.