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
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