Hide Sold Out Events in Widgets

Home Forums Ticket Products Event Tickets Plus Hide Sold Out Events in Widgets

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #986470
    wineschool
    Participant

    Is there a way to hide sold out events when using widgets?

    I would very much like to use the Event Listing widget on my front page. However, I can’t clog it up with sold out events.

    #986626
    Brian
    Member

    Hi,

    Thanks for using our plugins I can help out here.

    There is no feature to hide events in a widget if the tickets are sold out.

    It could be possible to customize the widget template and hide the event if the tickets are sold out.

    We can help you get started on a customization like that, but not able to provide all the coding to do it.

    Let me know what you would like to do.

    Thanks

    #986679
    wineschool
    Participant

    Any help would be awesome, and I will share the final project with the EC community.

    #986982
    Brian
    Member

    Hi,

    To get started you can modify any of the widgets or widget shortcodes templates by following our themer’s guide:

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

    To determine if the tickets are sold out you have to first get the ticket products per event, this query does that:

    $query = new WP_Query(
    array(
    'post_type' => 'product',
    'meta_key' => '_tribe_wooticket_for_event',
    'meta_value' => $event_id,
    'meta_compare' => '=',
    'posts_per_page' => - 1,
    'fields' => 'ids',
    'post_status' => 'publish',
    )
    );

    You will need to make sure you pass the event id to this variable $event_id.

    From there you will have to figure out how to determine if it is out of stock, I do not have coding to do that unfortunately.

    I would look at our functions and methods in these two files:

    \wootickets\src\Tribe\Main.php

    \wootickets\src\views\wootickets\tickets.php

    And use that to figure out the rest.

    I maybe to help answer a specific question or two, but beyond that I am unable to support this much more.

    Cheers

    #988164
    wineschool
    Participant

    Thank you for the starting point. I’ve brought in a developer to help me write the plugin. We are working on a beta release right now.

    I’ll supply the repository link once we are a bit further on.

    FYI, this was also feature request posted on uservoice: https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/6864872-shortcode-or-widget-to-show-available-events-not

    #988187
    Brian
    Member

    Hi,

    Thanks for the info.

    I did not realize we had a function that may help out.

    This article has a couple functions that you might find useful for this.

    It would still take some development to get it how you like, but might cut out some steps:

    https://theeventscalendar.com/knowledgebase/adding-sold-out-notices-in-list-view/

    Sorry for not bringing this up sooner.

    #993082
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Hide Sold Out Events in Widgets’ is closed to new replies.