Home › Forums › Ticket Products › Event Tickets Plus › Replace RSVP contact details with attendee details
- This topic has 2 replies, 2 voices, and was last updated 7 years, 10 months ago by
Peter Monk.
-
AuthorPosts
-
June 5, 2018 at 6:57 pm #1546996
Peter Monk
ParticipantHi,
We take RSVP bookings for events. There is always only a single attendee per RSVP.
We did not want people to have to enter their name and email twice (seems silly!) so I hid the RSVP contact fields from the RSVP form and instead hard-coded some filler values into these fields (as the booking form would not submit without them).
Then I modified the RSVP.php file to grab the name and email of the first (and only) attendee and replace the filler RSVP contact details with the attendee details during the ticket save process.
This worked fine!
However, we’ve updated to the latest version of the plugins and the code in RSVP.php has changed quite a bit.
I can’t locate the exact spot where I need to do the replacement of details.I’m not looking for you to write code for me, but it would be useful to have a little info on one or both of the following questions:
1. In which function do the RSVPs actually get saved to the database?
2. Is there an easier method than the above to substitute the attendee details for the RSVP contact details (such as with a functions.php snippet)? I already use a few of these and its nice not to have to go digging around in the core code.
Thanks,
Peter.June 5, 2018 at 8:24 pm #1547051Peter Monk
ParticipantHi again,
Never mind, I’ve figured it out.
At line 525 of the event-tickets/src/Tribe/RSVP.php file, I’ve added:
$my_post_id = $_POST['product_id'][0]; $attendee_details['full_name'] = $_POST['tribe-tickets-meta'][$my_post_id][1]['first-name'] . ' ' . $_POST['tribe-tickets-meta'][$my_post_id][1]['last-name']; $attendee_details['email'] = $_POST['tribe-tickets-meta'][$my_post_id][1]['email-address'];This results in my filler name and address being replaced by whatever name and address was entered in the attendee first name, last name and email address boxes.
Cheers,
Peter.June 6, 2018 at 8:08 am #1547431Victor
MemberHi Peter!
Glad to know you could achieve what you were looking for. Thanks for following up to let us know 🙂
Do bear in mind, that editing core plugin files is not a good practice as these changes will be overwritten when updating the plugins.
Since you marked this Resolved I’ll go ahead and close this thread now, but feel free to open a new topic if anything comes up and we’ll be happy to help.
Cheers,
Victor -
AuthorPosts
- The topic ‘Replace RSVP contact details with attendee details’ is closed to new replies.
