Hi Gab,
Events Manager was not build to handle virtual events, so technically you do need a maximum. ?? Here’s the workaround.
First, let’s create that default, free ticket and set the number of available applicants to 1000. (increase the number if you want even more, hehehehe).
Add this to your functions.php
function em_create_free_default_ticket($EM_Ticket) {
if ( empty($EM_Ticket->ticket_id) ) {
$EM_Ticket->ticket_name = 'Available';
$EM_Ticket->ticket_spaces = 1000;
$EM_Ticket->ticket_description = '';
$EM_Ticket->ticket_price = 0;
$EM_Ticket->ticket_min = 1;
$EM_Ticket->ticket_max = 1;
}
}
add_filter('em_ticket', 'em_create_free_default_ticket', 10, 2);
That will set the default ticket in every new event to this:
https://paste.pics/93b90f82c36dba1db6f6ab19e58a6c79
Now, we need to hide that complete section from the view in the front-end event submission form, right? Add this also to your functions.php file:
function em_hide_ticket_options_in_frontend_submission($EM_Event) {
?><script>
jQuery.noConflict();
jQuery(document).ready(function() {
// Automatically check the checkbox to allow registrations. Disable it to prevent any changes.
jQuery('#event-rsvp').prop('checked', true).attr('disabled', 'disabled');
// Hide the <h3>Bookings/Registration</h3>
jQuery('.event-form-bookings').prev('h3').hide();
// Hide the rest of the Ticket Form.
jQuery('.event-form-bookings').hide();
});
(jQuery);
</script><?php
}
add_action('em_front_event_form_footer', 'em_hide_ticket_options_in_frontend_submission');
Tada! ??
Now, up to 1.000 applicants can click the Submit Button in the booking/application form to tell you they are available. In the Admin you can manage these entries as “normal” bookings.
Because we set both the min and max number of tickets to 1, EM will automatically recognize that the spaces dropdown makes no sense. So, it’s hidden from the actual booking form.
The default ticket will also be created for the Admin, but the metabox will still be shown and the checkbox will not be disabled.
Let me know if this works.