Support

Home Forums Event Espresso Premium What's the right way to setup class registration w/ parents and children

What's the right way to setup class registration w/ parents and children

Posted: August 19, 2022 at 3:23 am


Rock-It Science

August 19, 2022 at 3:23 am

I’m trying to setup a class registration form where we collect parent information and then one or more students information that can be applied to one more more classes.

At first I tried setting up the forms so the parents were the primary registrants (system required registrants). Everything was fine until I get to the email setup and realized the emails made it look like the parents were attending the classes. I did not see a way to include, in the email, the student name questions I had setup separately.

So I tried to switch it and make the students the primary registrants (system required registrants). This seems to work well in terms of email, but now during sign-up each student needs an email address. Many of these are students are small children, so they don’t have one yet.

An added layer of complexity is we’d like to create accounts when a registration is complete so parent’s don’t need to re-enter their information every session. Having the parent as the primary registrants seems like the way to do that (i think?).

Basically this would all work as planned if I were able to add the custom student registration names to the emails (question label ‘student-first-name’ and ‘student-last-name’), but I didn’t see a way to do that.

What’s the right way to do this?


Tony

  • Support Staff

August 19, 2022 at 9:47 am

Hi there,

At first I tried setting up the forms so the parents were the primary registrants (system required registrants).

I need to clarify this part, because within EE there will only ever be one single primary registrant for a group registration.

A single registration (selecting 1 ticket) has a group of 1, the registrant there is technically the primary registrant and the registrant.

A group (selecting X tickets) has 1 Primary Registrant (the first ticket) and then X registrants.

Everything was fine until I get to the email setup and realized the emails made it look like the parents were attending the classes. I did not see a way to include, in the email, the student name questions I had setup separately.

Whilst you ‘can’ set up the email to show the custom questions you are using, I would say in terms of Event Espresso it sounds like you are setting it up backwards. More on this shortly.

So I tried to switch it and make the students the primary registrants (system required registrants). This seems to work well in terms of email, but now during sign-up each student needs an email address. Many of these are students are small children, so they don’t have one yet.

In this case, the children do indeed need to be set up as the registrants and to do that you need to use the 3 system questions (First Name, Last Name and Email) in the ‘personal info’ group. So the children are the registrants attending the event and the parent is an additional set of questions assigned only to the primary registrant.

Yes, they will require an email address but it’s possible to hide the email field and fill it in in the background using the value from the parent’s email field.

An added layer of complexity is we’d like to create accounts when a registration is complete so parent’s don’t need to re-enter their information every session. Having the parent as the primary registrants seems like the way to do that (i think?).

This is not something you can do with just core code within Event Espresso, you will need custom development for this to work. ‘Some’ of that functionality is available but creating accounts for parents/teacher

Basically this would all work as planned if I were able to add the custom student registration names to the emails (question label ‘student-first-name’ and ‘student-last-name’), but I didn’t see a way to do that.

Sort of, it will sort of work with that setup but the parent shows up as a registrant.

Can you link me to the event you have so I can take a look and advise from there?


Rock-It Science

August 19, 2022 at 11:34 am

Thanks for the help on this, Tony.

Here is a sample page with the student as the primary registrant: https://rockitscience.com/?p=12171

Where can I find more information on this:

Yes, they will require an email address but it’s possible to hide the email field and fill it in in the background using the value from the parent’s email field.


Tony

  • Support Staff

August 22, 2022 at 9:18 am

Yes, they will require an email address but it’s possible to hide the email field and fill it in in the background using the value from the parent’s email field.

It’s not an official feature within EE but you can do it with some JavaScript, here is an example:

https://gist.github.com/Pebblo/f27056f2bcf220f5d391

Although the code will need to be altered to suit your specific needs.

I looks like you have most of it set up to use the Student as the registrant which is how I would do it.

Which email fields are you going to be hiding in this set up?


Rock-It Science

August 25, 2022 at 11:26 am

Thanks for this snippet Tony. I was able to use a modified version to take the input from the “Parent Email Address” and “Parent Phone Number” questions and inject them into the required questions which are hidden via CSS.

The modified script:

add_action( 'wp_enqueue_scripts', 'tw_ee_hide_additional_email_questions', 11 );
function tw_ee_hide_additional_email_questions() {
wp_add_inline_script(
'single_page_checkout',
"jQuery( document ).ready(function( $ ) {
$('.ee-reg-qstn-36').on('keyup change paste', function(e){
$('.ee-reg-qstn-email').val($(this).val())
});
$('.ee-reg-qstn-37').on('keyup change paste', function(e){
$('.ee-reg-qstn-phone').val($(this).val())
});
$('.spco-attendee-panel-dv').each( function() {
$(this).find('.ee-reg-qstn-email-input-dv').hide();
$(this).find('.ee-reg-qstn-phone-input-dv').hide();
});
});"
);
}

During testing my colleague said that when she tried to register two students for two different classes, it hung at the spinning gear between submitting the registration information and the payment screen. But it works fine on my end.

What’s the best way to debug this since we’re not in the same physical location?


Tony

  • Support Staff

August 26, 2022 at 6:54 am

Hmmm, so, the spinning icon means the ajax request failed and if no error was shown on the page it means either no response was received at all from the request, a fatal error was thrown on that request (usually EE would then display something like ‘The registration step could not be complete, please refresh the page and try again’ if that was the case) OR something else hooked into the ajax request and added additional output which EE does not know how to interpret.

First thing to check is are you both doing performing the same steps using the same registration data?

For example, are you both logged out when testing, same event(s), number of tickets etc and same registrant data before proceeding?

Check the servers error logs around the time that user is getting the cog, see if anything is logged at the same time.

If your colleague is able, they could check Chrome Dev Tools to see what happens with the ajax request, it’s relatively simple to do.

You open Chrome Dev Tools and select the network tab, right before you click on the Proceed button. Like this:

https://monosnap.com/file/ZGgVN0QilookR2VHk5hqnx7VT98sg7

(Make sure the ‘Preserve Log’ checkbox is check within dev tools so that if the page changes the details are still in the network tab)

As you are on the network tab when you click on the proceed button, Chrome will display the requests in a waterfall.

You should see admin-ajax.php listed at least once as soon as you click the Proceed button.

Here’s an example of mine: https://monosnap.com/file/8bWHvdz8WPGh9ELChHGop99vroszRa

Clicking on each request and then checking the response you can see what was returned on that request. Either take a screenshot of those or post the response data and I’ll take a look.

Or, send over the details of what to test and a link to the event and I’ll see if I can reproduce it (you can mark your reply private so only EE staff can view it)

The support post ‘What's the right way to setup class registration w/ parents and children’ 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.

Event Espresso