I’m using this code to check if a registration is done with a specific email adres and change the status and send a confirmation email. I also would like to hide a (registration) question and make it optional instead of required.
I tried adding css to hide ‘spco-attendee-panel-dv’ after the IF but it did not work.
Any pointers how I go about this?
add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'update_registration_based_on_email', 1, 2);
function update_registration_based_on_email(EE_Registration $registration, $update_params = array() )
{
$attendee_email = $registration->attendee()->email();
error_log('update_registration_based_on_email function executed');
if (strpos($attendee_email, '@uzgent.be') || strpos($attendee_email, '@ugent.be')) {
$registration->set_status('RAP');
$registration->save();
add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
//EEM_Registration::maybe_registration();
error_log('email is @uzgent or @ugent');
} else {
error_log('email is not @uzgent nor @ugent');
}
}
The hook you are using would ‘fire’ after the registrations had been processed within Single Page CheckOut (SPCO for short).
SPCO is responsible for creating/managing the steps when creating registrations etc on the front end, it would also be what triggered the function to confirm all registration inputs were ‘valid’ (meaning required fields had values etc)
So the hook you are using for this would fire too late for you to make a change that would be useful in your situation. We have a hook you can use to hook into SPCO and access the registrations right before the reg step process them:
Note, I have tested switching reg questions to no longer be required with this but it would be where I would start, at least for the registration question part of your request.
Tried to hide the element, but this is beyond my capabilities :/
Viewing 2 reply threads
The support post ‘Hide and change question to optional – registration – checkout’ 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.