Support

Home Forums Event Espresso Premium Address on Invoice

Address on Invoice

Posted: March 8, 2014 at 10:51 am

Viewing 4 reply threads


Ben

March 8, 2014 at 10:51 am

WordPress 3.6
EE V3 – All add-ons – business license
New Installation
http://www.greatbunyagathering.com.au/event-registration/?ee=2

Hey Guys,
How can I add address1 above address2 in the invoice, as well as adding the country after the zip code?
Also in the screenshot, why is the address1 further down and out of running order of questions?
http://screencast.com/t/YuTuTdQooJV

Thanks
Ben


Tony

  • Support Staff

March 10, 2014 at 5:00 am

Hi Ben,

In order to add ‘Address’ you’ll need to modify the invoice gateway template.

event-espresso/gateways/invoice/template.php

Around line 140 you’ll find

//Set attendee address
$attendee_address != '' ? $pdf->Cell(100, 5, $attendee_address, 0, 1, 'L') : '';

With FPDF its not as simple as just echoing out the text, so we have to add something like this

//Set attendee address
$pdf->SetFont('Times', 'B', 12);
$pdf->Cell(50, 5, __('Address', 'event_espresso'), 0, 1, 'L'); //Set Address
$pdf->SetFont('Times', '', 12);
$attendee_address != '' ? $pdf->Cell(100, 5, $attendee_address, 0, 1, 'L') : '';

Which, sets the font to bold, creates a cell, outputs ‘Address’ within the Cell and then sets the font back to regular.

If you look at line 48 of that file you’ll see

//$attendee_country = $attendee->country_id;

Un-comment that line to pull in the Country, then use the $attendee_country to display it in a similar fashion to above.

Also in the screenshot, why is the address1 further down and out of running order of questions?

Have your altered the question number/order sequence of your questions? Look in Event Espresso -> Questions. (http://take.ms/eJTJ5)


Ben

March 10, 2014 at 8:53 am

Thanks Tony,

“Also in the screenshot, why is the address1 further down and out of running order of questions?”

Have your altered the question number/order sequence of your questions? Look in Event Espresso -> Questions. (http://take.ms/eJTJ5)

The questions are in sequence – http://screencast.com/t/YbZAKhIqU4W
The only thing is the secure system questions which is a difference, as you can see from the screenshot.

I’ve updated the invoice, the only thing that isn’t pulling through correctly is the ‘Address’, which I suspect has something to do with the order above?
See – http://screencast.com/t/QwhadmZf

Let me know if you need login access?

Thanks
Ben


Tony

  • Support Staff

March 10, 2014 at 9:08 am

Ahhh apologies, I thought you wanted an ‘Address’ heading, which is what the code above provides.

The reason you not seeing Address line 1 is you are using a custom question for Address, as opposed to the System Question ‘Address’ (which would have a padlock next to it within the list) if you view the full list do you not see another ‘Address’ only this one with a padlock?

If you view line 41 & 42 you can see the two system Address questions pulled from the attendee. Then concatenated together.

$attendee_address = html_entity_decode(stripslashes($attendee->address), ENT_QUOTES, "UTF-8");
$attendee_address .= isset($attendee->address2) ? "\n" . html_entity_decode(stripslashes($attendee->address2), ENT_QUOTES, "UTF-8") : '';

Currently the problem is the system Address is empty.


Ben

March 10, 2014 at 11:05 am

Thanks Tony,

That’s great, had to do a bit more shuffling around, but I’ve finally got it sorted now. The client had previously swapped all the system questions around.

Result – http://screencast.com/t/91JFGXKCb

Thanks
Ben


Tony

  • Support Staff

March 10, 2014 at 11:18 am

No Problem 🙂

Apologies for the mix up earlier!

Any other issues just let us know, I’ll mark this thread resolved.

Viewing 4 reply threads

The support post ‘Address on Invoice’ 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