Support

Home Forums Event Espresso Premium Dont require Email of children

Dont require Email of children

Posted: October 26, 2017 at 8:44 am

Viewing 12 reply threads


svmotor

October 26, 2017 at 8:44 am

Hello,

I created an event where parents can register their children. for the primary registrant they have to enter the name & email of the parents and the name of one child. (For children i created an extra question group). For all other registrants they only have to enter the name. But in the atendee list, for each child is shown the name of the parent. How can i fix this?

greetings


Tony

  • Support Staff

October 26, 2017 at 8:52 am

Hi there,

If you want the child to show as the registrant, you need to request the ‘Personal Information’ question group for additional registrants, you can’t collect the child details using custom questions.

You can then use some jQuery to hide the email question for additional registrants and copy the primary registrant’s value into them all (email is required so you can’t just remove it completely). There is a function for doing that here:

https://gist.github.com/Pebblo/44f47386d1221b7916d3ae906f6149c3

You can add that to a Custom Functions Plugin on your site.


svmotor

October 26, 2017 at 12:53 pm

Hello,
thanks for your fast reply. I tried the steps you sent but it does not work. I have activated the plugin but the other users have still to enter an mail address.

Is it possible to take the email from an other question into the database? The first atendee has for example also the question group “parent” and the answer of the question “email” in this group should be the main email address of this registration.

I hope my thinkings are clear
greetings


Josh

  • Support Staff

October 27, 2017 at 9:28 am

Is it possible to take the email from an other question into the database?

No.

When you had the plugin activated with the code that Tony shared with you, did you check to see if the jQuery code was embedded into the page source?

If you can reactivate the plugin that has the
tw_ee_copy_primary_email_to_all() and post a link here to the event in question, we can investigate further.


svmotor

October 30, 2017 at 3:54 pm

Hello,
sorry but i didnt understand your last reply. Could you please explain it again?

did you check to see if the jQuery code was embedded into the page source?
If you can reactivate the plugin that has the
tw_ee_copy_primary_email_to_all() and post a link here to the event in question, we can investigate further.


Tony

  • Support Staff

October 31, 2017 at 3:03 am

We want to confirm the code is actually running on your event page, so if you have disabled the plugin that has the code I gave you on your site, re-enabled it.

Then provide a link to one of your events so we can confirm the code is loading within the page and if so see if we can see why it doesn’t work.

Also are you using the WP user integration add-on to autofill the details on page load?


svmotor

October 31, 2017 at 11:23 am

Here is the url to a demo event: https://wintersport-tambach.de/register/zweitalsperrenlauf/

Iam shure that my plugin with the code you sent is enabled.


Tony

  • Support Staff

October 31, 2017 at 11:27 am

The Javascript used to copy the primary reigstrants email address to all th other fields is working, but the CSS used to hide them is not.

I’ve updated my gist with another selector that should work on your site.

Please update the plugin to use the updated code here:

https://gist.github.com/Pebblo/44f47386d1221b7916d3ae906f6149c3


svmotor

November 5, 2017 at 3:53 am

Hello,
now it works fine!Is there a possability to add an note to the email field of registrant #1 to show that they have to enter the email of an parent? And there now is an other problem: I only need this function for 2 or 3 of my events. Can I select, in which event the plugin is active?

Thank you very much


Tony

  • Support Staff

November 7, 2017 at 8:22 am

Is there a possability to add an note to the email field of registrant #1 to show that they have to enter the email of an parent?

Not without custom development.

And there now is an other problem: I only need this function for 2 or 3 of my events. Can I select, in which event the plugin is active?

Yes, it’s possible.

You can use some meta data within the events you want to hide the field on and then only output the above code on those events, here is another example showing how you can do that:

https://gist.github.com/Pebblo/44f47386d1221b7916d3ae906f6149c3#file-function-php

It’s the same code as above with an additional check to see if any of the events in the cart have a ‘hide_email_fields’ custom field set on them, if so it adds the code, otherwise it does not.

So you add a custom field for the events you want to do this on like this – http://take.ms/3zwd4

Note that the snippets we provide are intended as a base on which you can continue to develop your own solutions from, we provide support for EE and will often help point you in the right direction with various snippets if we can but the snippets should be considered unsupported and you’ll want to fully test they work how you expect.


svmotor

November 12, 2017 at 6:26 am

You can use some meta data within the events you want to hide the field on and then only output the above code on those events, here is another example showing how you can do that:

That works really nice! Thank you

Not without custom development.

But is it possible to use an other registration page when the custom field is active? So I could write a short note at the top of the page. Therefor I can use a Shortcode before the EE Shortcode:

[alert style="warning"]Information[/alert]
[ESPRESSO_CHECKOUT]

But I only need this note for some events.

For example:
Event 1 -> domain.com/Registration-Page (without note)
Event 2 -> ‘hide_email_fields’ = true -> domain.com/Another-Registration-Page (with note at top)

I hope you can understand my problem


Tony

  • Support Staff

November 13, 2017 at 4:09 am

You can’t link to a different checkout page, EE can only have a single checkout page regardless of how many pages you add the shortcode to as you need to select the correct page within Event Espresso -> General Settings -> Critical pages.

However, there are hooks within the checkout process you can use to add a notice.

So you could use the ‘AHEE__SPCO__before_registration_steps’ hook, check if the current step slug is ‘attendee_information’ and then check the events in the cart
for the meta value from above and output the notice if its set.

Example of how to check for the checkout step – https://gist.github.com/Pebblo/f8a69799add1709c4954e43d919585ef

Example of how you can pull the events from the session – https://gist.github.com/Pebblo/f4561461339c59411a849f93c91912a9


svmotor

November 14, 2017 at 12:53 pm

Hello, now everything works fine 🙂
Iam very happy you helped me.

Have a nice day

Viewing 12 reply threads

The support post ‘Dont require Email of 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