Support

Home Forums Event Espresso Premium Invoice Customization – is this possible?

Invoice Customization – is this possible?

Posted: January 16, 2014 at 4:21 am


Paul Miller

January 16, 2014 at 4:21 am

I’d like to have the invoice “Bill To:” field to be filled from a question field I added on our registration page, is this possible? For example, our business deals with schools so I have added a ‘School Name’ field on the registration page. How do I get this field onto the invoice? I’ve had a look at the invoice template and successfully changed a couple of other items but I cant see where the invoice would pull this field from. I’m new to this and the learning curve is steeeeeep! Thanks in advance.


Tony

  • Support Staff

January 16, 2014 at 6:29 am

Hi Paul,

Unfortunately what you are trying to do is not that easy.

Non of the custom questions/answers are pulled into the template so you would need to write your own custom query to do it.

I’ll investigate a little further and see if this can be done an easier way.


Paul Miller

January 16, 2014 at 2:18 pm

Thanks Tony, please do, I need this up and running in a few days.
Cheers.


Tony

  • Support Staff

January 17, 2014 at 2:56 am

Hi Paul,

You can pull in custom answers using the [EE_ANSWER] shortcode, this needs the Question ID (q) and Attendee ID (a) supplied to it.

Within the template the Attendee ID has been stored in $attendee_id so we can use that, q is a little more difficult, as it will be different for each question, but also different on each install (as how many questions you have and the order in which you created them will be different from my own)

To find this go to Event Espresso -> Questions. Find The question and click on it (in this example I have used ‘Test q’ http://d.pr/i/r1fx)

Look at the URL in the address bar and you’ll see question_id=** (mine is 11) http://d.pr/i/et37

Use that number within the shortcode for q. So mine would be:

do_shortcode('[EE_ANSWER q="11" a="'.$attendee_id. '"]');

To add this as part of the Bill to address (So it shows Name, email, This custom question and then the usual address fields) look on line 41, you should have:

$attendee_address = html_entity_decode(stripslashes($attendee->address), ENT_QUOTES, "UTF-8");

Change the = to a .= and add this above that line

$attendee_address = do_shortcode('[EE_ANSWER q="11" a="'.$attendee_id. '"]');

So you now have on lines 41-42

$attendee_address = do_shortcode('[EE_ANSWER q="11" a="'.$attendee_id. '"]');
$attendee_address .= html_entity_decode(stripslashes($attendee->address), ENT_QUOTES, "UTF-8");

*Please note whilst we often will help the best we can with modifications, we can not support them.


Paul Miller

January 18, 2014 at 2:09 pm

OK thanks, I’ll give it a shot and report back.


Paul Miller

January 19, 2014 at 5:18 pm

Hey Tony,

Just letting you know this worked a treat. I wanted the school name first on the invoice so the only other tweek I had to do was move the attendee ID up on the invoice template before the attendee name and email. Thanks so much, the support from you guys so far has been awesome!


Tony

  • Support Staff

January 20, 2014 at 4:52 am

No problem Paul 🙂

I’m glad it worked well for you.

Now you have modified the template I would recommend copying the entire ‘Invoice’ folder to wp-content/uploads/espresso/gateways/

This will keep your modified version ‘update safe’ so they wont be overwritten with each Event Espresso update.


Paul Miller

January 20, 2014 at 2:01 pm

Thanks for the tip, cheers.

The support post ‘Invoice Customization – is this possible?’ 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