Book 1 place at a class

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 5 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30725

    I have an exercise class 5 days per week, which has 6 places. There is no charge to book the place so it’s a free ticket. I would like to make this a recurring event so that I don’t have to create a new one every day.

    Bookees will be logged into the site as WP members. I want them only to be able to book 1 place per class.

    However, I do not want them to be able to book a place more than 6 days in advance.

    Is there a simple way to set this up please?

    I have looked in the forums, but I cannot see anything that answers this question. It’s probably there I know

    Thanks Very much for the help.
    Chris

    Chris Hirst
    #30822

    Hi Chris,

    To prevent bookings 6 days prior to the event occurrence starting:

    add_filter( 'eventorganiser_bookable_occurrences', function( $bookable, $event_id ) {
        $next_week = new DateTime( '+6 days', eo_get_blog_timezone() );
        foreach( $bookable as $occurrence_id => $occurrence ) {
            if ( $next_week > $occurrence['start'] ) {
                unset( $bookable[$occurrence_id] );
            }
        }
        return $occurrences;
    }, 10, 2 );
    

    To restrict to a single booking please see this thread for how to use radio buttons instead of inputs: https://wp-event-organiser.com/forums/topic/edit-ticketpicker-markup/

    To prevent additional bookings to an event please this tutorial: https://wp-event-organiser.com/blog/tutorial/limit-bookings-to-one-ticket/

    If you have any questions or need further assistance, please just let me know.

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.