Posted: April 10, 2015 at 2:16 pm
|
Hi, I have two items that I’m trying to do, but struggling and could use some help. I am using EE3 with the MER plugin enabled. 1. I would like to add the Attendee’s company to the invoice and I tried what was suggested here (https://eventespresso.com/topic/adding-company-name-to-invoice) without success. Instead, I currently have a blank line now between the name and email address. 2. Our standard event has over 75 attendees and when viewing the Attendee Reports and trying to export to Excel, it defaults to 50 rows at a time. Is there a way to set the default to a higher value? Thanks, |
Hi Remi, On your first question, note that the IDs that are referenced will be different for your own site. You can check by going to the registration forms area of Event Espresso within your WP dashboard and then browsing to that question. It will be a numeric value like 25. Next, when you applied the changes for that answer in the invoice, did you set it to look for your actual ID (numeric value) for your company question (attendee company question)? On your section question, the information is retrieved from the database so we’ve set it to default to a lower value. You can retrieve the additional records by adjusting the option that appears towards the top of the screen: http://cl.ly/image/0T1v3W3N3j2F — |
|
|
Hi Lorenzo, I have tried both the order/sequence number (2) and the id listed in the url (11) and neither worked. See question image here:. On the second item, I have been adjusting it using that box, but I would like for it to remember/default to 100 if possible. Thanks, |
Hi, there isn’t an option to change the default option from 50 at this time. If the question id is 11, then that is the answer ID that should be referenced. What is the exact code change that you applied to the invoice? Could you copy and paste it here? — |
|
|
This code was commented out. I un-commented it and changed the question id to 11. //Get the questions for the attendee $organization_name = $wpdb->last_result[0]->answer;//question_id = ’11’ I un-commented the variable line (line 47 on my template.php file): $attendee_organization_name = $attendee->organization_name; I also added a line in the section ‘Set the billing information’ to pull in this variable: //Set the billing information |
Alright, that block of code isn’t needed. Try reversing any changes. Then start the tutorial again from here: https://eventespresso.com/topic/adding-company-name-to-invoice/#post-86737 $organization_name = do_shortcode('[EE_ANSWER q="11" a="'.$attendee_id.'"]'); The above code sets a variable equal to the answer for your question which is the company name. Then you can use this to display the variable in the invoice: $pdf->Cell(50, 5, $organization_name, 0, 1, โLโ); — |
|
Hi Remi, If you notice in this post: https://eventespresso.com/topic/adding-company-name-to-invoice/#post-86056 I mention you can do this in a much easier way than using the above code ๐ This code: //Get the questions for the attendee $q_sql = โSELECT ea.answer, eq.question FROM โ . EVENTS_ANSWER_TABLE . โ ea LEFT JOIN โ . EVENTS_QUESTION_TABLE . โ eq ON eq.id = ea.question_id WHERE ea.registration_id = โโ.$registration_id.โโโ; $q_sql .= โ AND ea.question_id = โ11โ โ; $q_sql .= โ ORDER BY eq.sequence asc โ; $wpdb->get_results($q_sql); $organization_name = $wpdb->last_result[0]->answer;//question_id = โ11โ Should pull in the question and answer value for question id 11 and for a specific attendee. You can then use it within the template…. However, there is a much easier way that does the above for you. $organization_name = do_shortcode('[EE_ANSWER q="11" a="'.$attendee_id.'"]'); So comment out the first section of code again and add that just after it. Then, on line 47 you should something like this: $attendee_organization_name = $attendee->organization_name; You can comment that out again too. You should end up with something like this – http://take.ms/c7TBL That assigned the answer to ‘Company Name’ to the variable $organization_name So then you’ll change your billing information to this: //Set the billing information $pdf->SetFont(โTimesโ, โBโ, 12); $pdf->Cell(50, 5, __(โBill To: โ, โevent_espressoโ), 0, 1, โLโ); //Set biil to $pdf->SetFont(โTimesโ, โ, 12); $pdf->Cell(50, 5, pdftext($attendee_first . โ โ . $attendee_last), 0, 1, โLโ); //Set attendee name $pdf->Cell(50, 5, $organization_name, 0, 1, โLโ); //Set attendee company $pdf->Cell(50, 5, $attendee_email, 0, 1, โLโ); //Set attendee email Which should pull all the information in for you. Does that help? |
|
|
Lorenzo and Tony, Thank you both for the response. That helped and it is working. Thanks again! Remi |
The support post ‘Attendee Company to Invoice/Default # Rows on reports’ 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.