Knowledgebase

Check the knowledge base articles to get a jump start on your integrations, modifications, and all around user questions. If you don’t find what you’re looking for hit the help desk.

Search Knowledgebase

Adding sold out notices for tickets in List View

Important Notice:

⚠️ This customization is now handled for all users by default in Event Tickets Plus starting with version 4.5.  You can learn more about it at: Release: Event Tickets 4.5, Plus, The Events Calendar, and Pro  ⚠️


By default, Event Tickets Plus adds ticket information to single event posts in your calendar.

Sometimes though you may wish to add key information to other calendar views and, in this post, we’re going to look at an example of doing just this – by adding “Sold out!” notices to list view.

Please note that we’re going to make use of template overrides to do this, so if you haven’t already done so please familiarize yourself with our Themer’s Guide for The Events Calendar and the WordPress.org Codex article on Child Themes.

With that done, please locate the following file:

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

Place a copy in your theme, within your tribe-events subdirectory, something like this:

wp-content/themes/my-child-theme/tribe-events/list/single-event.php

Now, you need to choose where exactly you want the notice to appear. We recommend you put it just after:

<a class="url" href="<?php echo tribe_get_event_link() ?>"; title="<?php the_title() ?>" rel="bookmark">
    <?php the_title() ?>
</a>

What we’re going to do here is make use of the tribe_events_has_soldout() template tag: this works with any of our ticketing framework plugins and tests to see if tickets exist and if they all have zero stock.

Try adding the following code right after the last section:

<?php if ( tribe_events_has_soldout() ): ?>
    <span class="tickets-sold-out">
        Sold out!
    </span>
<?php endif ?>

This should add a nice, easily stylable Sold out! notice. You could even expand on this to highlight events that still have some tickets left:

<?php if ( tribe_events_has_soldout() ): ?>
    <span class="tickets-sold-out">
        Sold out!
    </span>
<?php elseif ( tribe_events_has_tickets() ): ?>
    <span class="tickets-in-stock">
        On sale!
    </span>
<?php endif ?>

We hope that gives you some ideas – and if you need further help please don’t hesitate to reach out to the team over at our help desk.

Good luck!