Posted: March 8, 2014 at 10:51 am
|
WordPress 3.6 Hey Guys, Thanks |
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.
Have your altered the question number/order sequence of your questions? Look in Event Espresso -> Questions. (http://take.ms/eJTJ5) |
|
|
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 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? Let me know if you need login access? Thanks |
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. |
|
|
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 |
No Problem 🙂 Apologies for the mix up earlier! Any other issues just let us know, I’ll mark this thread resolved. |
|
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.