Force – Out Of Stock

Home Forums Ticket Products Event Tickets Plus Force – Out Of Stock

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1077881
    Lady Berry
    Participant

    Hi,

    Is it possible to force an event/ticket to appear out of stock. I may need to cancel the event before any tickets are sold but instead of the event disappearing id like them to say “Out Of Stock”

    Thanks
    Ben

    #1078102
    Brian
    Member

    Hello,

    As for this we do not have any features to do this.

    You could cancel the tickets and then just add Out of Stock in the event title or content.

    There could be a more customized solution you could code into the template maybe following our themer’s guide:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    We try to help answer questions to get people started on customizations, but for the most part we are only able to support the features as they are.

    Let me know if you have any follow up questions.

    Thanks

    #1078592
    Lady Berry
    Participant

    No worries,

    I have coded my own OUT OF STOCK – had just wondered if I was reinventing the wheel 🙂

    Do you know which template is used for the list view?

    is it:
    /wp-content/plugins/the-events-calendar/src/views/list.php

    MY CODE:

    <?php
    /* ALLOW ACCESS TO THE TICKET ON THIS PAGE */
    $woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
    $tickets = $woo_tickets->get_tickets( get_the_ID() );

    if ( ! empty( $tickets ) ) {

    foreach ( $tickets as $ticket ) {
    /* SET VALUE OF THE TICKET STOCK MESSAGE */
    $thisvalue = tribe_tickets_get_ticket_stock_message($ticket);
    /* SET VALUE FOR EVENT URL */
    $thisurl = esc_url( tribe_get_event_link() );
    /* IF STOCK MESSAGE CONTAINS SOLD ALL 0 (OR FORCED THE STOCK TO 0) */
    if (strpos($thisvalue, ‘Sold all 0’) !== false) {
    /* SHOW SOLD OUT */
    echo ‘<span style=”font-size:1.3em;”>SOLD OUT!</span>’;
    }else{
    /* SHOW BUY NOW */
    echo “BUY NOW!</br> $thisvalue”;
    }

    }
    }
    ?>

    #1079473
    Brian
    Member

    Yes that is the start of the list view template:

    /wp-content/plugins/the-events-calendar/src/views/list.php

    The rest are in this directory:

    plugins/the-events-calendar/src/views/list

    #1085858
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Force – Out Of Stock’ is closed to new replies.