Support

Home Forums WP User Integration Linking Questions to User Meta

Linking Questions to User Meta

Posted: January 13, 2015 at 8:47 am

Viewing 1 reply thread


Christine

January 13, 2015 at 8:47 am

Wordpress Version: 4.1
EE3 Version: 3.1.36.6.P
Installation: No recent updates
Website: http://www.InterstateTraining.com/register

I am trying to get customer Meta information to auto-populate the Event Espresso “Questions” that appear when registering for an event. I have already found a way to add the meta boxes under their user profile. I now am looking to update those meta boxes when they answer the event “Questions” OR, if they fill out the information under their user profile, have it auto-populate when they’re registering for the event. Screenshot link below.

Interstate National Training Event Registration.png

Is this possible?

Thanks,


Dean

January 14, 2015 at 1:19 am

Hi,

Saving the question data to user meta shouldn’t be too hard, I would look at hooking in on action_hook_espresso_save_attendee_data and grabbing the $_POST data and saving it from there.

The awkward part is making sure you have the right ID/name for the question.

Auto filling the questions is harder. I haven’t delved into it but looking at the code, the best bet would be to create a custom event_espresso_add_question_groups function as it is pluggable (/wp-content/plugins/event-espresso/includes/functions/main.php) that way you can inject the answers in.

As an example I used this in the function, so it would add text to the answer field for the question with the ID 12 (this ID is the internal database ID, NOT what is shown via the HTML):

if($question->id == 12) { $answer = “works”; }

screenshot: http://take.ms/Sf2OE

If you are not sure how to use the above information, then I would suggest contacting one of our recommended developers: https://eventespresso.com/developers/event-espresso-pros/

Viewing 1 reply thread

The support post ‘Linking Questions to User Meta’ 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