Posted: March 2, 2017 at 10:13 am
|
Hello I tried to follow the instructions from this post https://eventespresso.com/topic/invoice-edit-to-add-a-question-company-name/#post-58301 but it didn’t work for me. The “Bill to” part in my pdf invoice currently gives: I would like to add the company name before the email, and the country at the bottom (and if possible the Street Adress 2). Here is what I have in my template invoice: (in wp-content/plugin/event-espresso.3.1.36.6.P/gateways/invoice/template //Query Database for event and get variable $organization_name = $wpdb->last_result[0]->answer;//question_id = ’13’ And a bit further: $pdf->Ln(10); I hope you can help! Thanks! |
Hi there, I can see at least one mistake in your code that should be fixed. The line of code that his this: needs to be changed to: |
|
|
Thank you Josh! I am adding another part of my code that I think might be part of the problem. $attendees = $wpdb->get_results(“SELECT a.*, e.event_name FROM ” . EVENTS_ATTENDEE_TABLE . ” a JOIN ” . EVENTS_DETAIL_TABLE . ” e ON e.id=a.event_id WHERE a.registration_id ='” . $registration_id . “‘ order by a.id LIMIT 0,1 “); foreach ($attendees as $attendee) { |
I’m afraid I’m having a difficult time reading your code since it’s not formatted as code. Can you post the entire contents of the code file you’re working with into a pastebin or github gist, then link here? |
|
|
Yes, here it is: http://pastebin.com/fGSu5ZXB |
Is there a reason why you removed the calls to the pdftext() function in many places? |
|
|
I did not create the code myself, I am not sure if there was a reason to do so in the first place. Should I add them back? |
Yes that may help. If you compare your modified file to the original you’ll see where the calls to pdftext() were removed: |
|
|
Hello Josh, I made another try and the company name still doesn’t appear. Here is the code: http://pastebin.com/JEuEiP7n |
You’re missing a left bracket on line 190: That should be fixed so it’s: |
|
I tested the code in this copy of the file and it works on my test site: https://gist.github.com/joshfeck/7efc568cf75a831d7909cf735de7aaa0 |
|
|
Hello Josh, Thank you! Could it have anything to do with the way my questions are made? Thank you! |
The way your questions are made should be fine. It’s more likely that your custom code isn’t actually loading. May I ask where are your custom invoice templates located on the server? i.e. which directory are they in? |
|
|
I think the problem is there, But I found out I have another event espresso folder here: I tried to change the new code in the new folder but now when I click on pdf invoice a blank page opens. |
The blank page is a fatal error. You’ll need to make sure you have the newer version of Event Espresso 3 activated and you can find what’s causing the fatal error by turning on WP_DEBUG. You can also check the /wp-content/uploads/espresso/gateways directory and look for an invoice folder there. |
|
|
I managed to get back so it wouldn’t get a fatal error; I noticed the code in the folder is slightly different (especially between 159-176) but I’ll leave it as is unless there is important mistakes. I ended up with white space between the email and the address but the company name still doesn’t appear. I also tried to add the Attendee_country after the city and state but it doesn’t appear either. I’ll keep trying to see if something can solve this; I would need the approval from the external developer to do change the version and he is not very available now so I would rather live it as is if I cannot find a solution with this version. |
You should try to get approval to update the site to have the current version of Event Espresso 3, which is currently 3.1.37.11. The version you have right now is missing more than a few security and WordPress compatibility fixes. Basically your version was compatible with the version of WordPress that was available in 2012, which was around WordPress 3.4. |
|
|
I guess I’ll have to, thank you! |
The support post ‘Bill to in the pdf invoice. Adding a new field not working’ 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.