Support

Home Forums Event Espresso Premium Merge Custom Answer Fields

Merge Custom Answer Fields

Posted: February 27, 2014 at 4:31 pm


Striking Idea

February 27, 2014 at 4:31 pm

I am using EE3 for Summer Camp registration where a Parent signs-up for 1 or more campers/attendees. I am using many custom Questions to fulfill this need, the most important being that I need to separate the Parent who will be filling out the billing information and receiving confirmations and the Campers/Attendees who are filling up an attendee space.

I am using the default First Name, Last Name and Email Fields to accommodate the fist Camper/Attendee, and am using Custom Question Text fields to pullin Parent information… Long story short.. on the Confirmation and Billing pages, I need to pull in the Custom Answers for the Parent instead of the default $fname and $lname. How do I create a custom field to replace where $fname and $lname are?


Josh

  • Support Staff

March 3, 2014 at 1:42 pm

Hi there,

Instead of creating a custom field to replace what the Billing pages use, I’d recommend using custom fields for the camper first name/last name. Then the system questions for first name and last name can be re-labeled to be used to fill out the parent’s first/last names, which will auto fill onto the billing form.


Striking Idea

March 3, 2014 at 1:46 pm

Yes, I have tried it that way. The problem is the Parent is not an Attendee.. the Camper is. So in the Admin it is confusing since it list the system fields as an attendee.


Sidney Harrell

March 3, 2014 at 4:15 pm

It’s possible to do what you are asking, but it’s going to take some work. In the confirmation_display.php template, you have the $questions variable available, which will contain the information you want. But to access it, you are going to have to loop through the $questions array, which has a structure that looks like:

		array(4) {
  [0]=>
  object(stdClass)#197 (2) {
    ["answer"]=>
    string(6) "Sidney"
    ["question"]=>
    string(10) "First Name"
  }
  [1]=>
  object(stdClass)#196 (2) {
    ["answer"]=>
    string(13) "Custom Answer"
    ["question"]=>
    string(20) "Custom Text Question"
  }
  [2]=>
  object(stdClass)#194 (2) {
    ["answer"]=>
    string(7) "Harrell"
    ["question"]=>
    string(9) "Last Name"
  }
  [3]=>
  object(stdClass)#199 (2) {
    ["answer"]=>
    string(24) "sidney@eventespresso.com"
    ["question"]=>
    string(5) "Email"
  }
}
	

testing against each object’s question field until you find the one you want, and grabbing it’s answer to use in the display. Similarly, you would have to alter the payment_page.php and payment_overview.php templates. But there you will probably not have the questions already pulled. You might have to use the attendee id and pull the answers from the DB.

The support post ‘Merge Custom Answer Fields’ 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