Home › Forums › Ticket Products › Event Tickets Plus › Hide Sold Out Events in Widgets
- This topic has 6 replies, 3 voices, and was last updated 10 years, 8 months ago by
Support Droid.
-
AuthorPosts
-
July 14, 2015 at 6:14 pm #986470
wineschool
ParticipantIs 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.
July 15, 2015 at 8:25 am #986626Brian
MemberHi,
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
July 15, 2015 at 10:23 am #986679wineschool
ParticipantAny help would be awesome, and I will share the final project with the EC community.
July 16, 2015 at 7:14 am #986982Brian
MemberHi,
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
July 20, 2015 at 3:10 pm #988164wineschool
ParticipantThank 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
July 20, 2015 at 4:37 pm #988187Brian
MemberHi,
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.
August 4, 2015 at 7:05 am #993082Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Hide Sold Out Events in Widgets’ is closed to new replies.
