Hi! I have a radio button selection in my registration form for enrollment to workshops, for which I need to disable the option once maximum capacity is reached which can differ per option.
What would be the most appropriate solution to implement this?
I thought about adding a plugin with a function that validates the sum of registrations to each workshop against max capacity, which can differ per option.
What would be the most appropriate solution to implement this?
I thought about adding a plugin with a function that validates the sum of registrations to each workshop against max capacity. Any recommendations?
add_filter(
'FHEE__EE_Question__generate_form_input__return',
'my_custom_function',
10,
4
);
function my_custom_function(
$result,
$registration,
$question,
$answer
) {
// Add logic here
// you have access to the $registration, $question, and $answer objects
return $result;
}
With access to the 3 objects listed above you can get just about any related data you’ll need to perform the logic of checking number of existing answers in the database and so on. We recommend using the built-in model system for retrieving that data.
The support post ‘Disable radio button option based on number of registrations’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.