add fully booked behind dates with [event rocket] or [tribe_mini_calendar]

Home Forums Calendar Products Events Calendar PRO add fully booked behind dates with [event rocket] or [tribe_mini_calendar]

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #969526
    thomas
    Participant

    george, i just found out that the “post types order” plugin from nsp code interfeared with the events query.
    i unchecked “admin sort” and “automatic sort” and the dates are shown in ascending order no matter what i checked.
    the thing is i need to order the posts and will see if there is a way to exclude event tribe posts from the plugin.
    maybe you know it and allready have a solution…

    #969548
    George
    Participant

    Hey Thomas,

    This thread was marked “resolved”, though it doesn’t seem to be – did you happen to accidentally check that option? No worries if so! I won’t close up the ticket, just wondering.

    The questions about another plugin are unfortunately not ones we can field here – if that plugin is interfering with queries it shouldn’t be (or that you don’t want it to be), the best thing to do would be to look through its code directly and find where the actual set of post types where it applies its rules is generated. You should be able to write some code to filter out the tribe_events post type.

    As for showing “Fully booked” text if the event is sold out, there are a few ways to do this. You could wire up some custom code that pulls in data from the tickets meta information, though it is a bit complex and beyond the scope of code examples we could provide here.

    Alternatively, you could just use a custom field of your own, which is quite simple. You can add one right from your admin, like in the “Custom Fields” section of this screenshot → https://cloudup.com/c-b70VtG0ZJ

    If you keep the Name of the custom field consistent, and have the value of it consistent (i.e. always either just “yes” or “no”), then you could check for that on your site by using get_post_meta(). You can read about this function at http://codex.wordpress.org if you’re not familiar, but using the field I created in the screenshot above, you’d do something like this:

    
    $is_fully_booked = get_post_meta( get_the_ID(), '_example_is_fully_booked', true );
    

    Then, check if $is_fully_booked is yes or no in that same filter I demonstrated several posts above in this thread. Something like this:

    
    add_filter( 'tribe_events_event_schedule_details', 'thomas_example_filter', 10, 2 );
    
    function thomas_example_filter( $schedule, $event_id ) {
    	$is_fully_booked = get_post_meta( $event_id, '_example_is_fully_booked', true );
    
    	if ( ! empty( $is_fully_booked ) && 'yes' == $is_fully_booked ) {
    		return '<span class="event-is-fully-booked">Fully Booked</span>' . $schedule;
    	}
    
    	return $schedule;
    }
    

    Play around with this stuff, it should be useful and hopefully you can make something good here. You’ll unfortunately have to take the reins from here, but let us at least know if it helps you get started 🙂

    — George

    #969561
    thomas
    Participant

    hey george,

    since the exclusion of the event tribes order in the plugin is only available in advanced version i switched to another plugin.

    simple post types order
    there i can include and excludes posts, categories…
    everything is working fine!

    #969569
    George
    Participant

    Cool, glad to hear it. Best of luck with your project!

Viewing 4 posts - 16 through 19 (of 19 total)
  • The topic ‘add fully booked behind dates with [event rocket] or [tribe_mini_calendar]’ is closed to new replies.