Support

Home Forums Event Espresso Premium Invoice-Primary Registrant only

Invoice-Primary Registrant only

Posted: October 24, 2014 at 8:27 am

Viewing 14 reply threads


Michael

October 24, 2014 at 8:27 am

I’m looking at the receipt_body.template and I want to modify it to show only the Primary Registrant’s details. I’m guessing it’s this part in div.ticket-registrations-area:

<?php foreach($registrations_per_line_item[$line_item_id] as $registration){
									/* @var $registration EE_Registration */
									$attendee = $registration->attendee();

Is there something I can replace attendee with to target only the primary registrant? I don’t ask for attendee information besides the primary, so these invoices currently list the primary registrant and details x times, once for each ticket in the transaction.

thanks


Michael

October 26, 2014 at 2:01 pm

just making sure this question wasn’t overlooked. thanks


Dean

October 28, 2014 at 6:40 am

Hi,

Something like this should work


= 1) { continue; }
$ii++;
	


Dean

October 28, 2014 at 6:40 am

Please note that our forum adds an extra space in the php eg < ?php, this needs to be removed.


Michael

October 28, 2014 at 8:49 am

sorry, I’m probably just pasting that in the wrong place (near the top, overwriting the part I quoted in the first post):

<div class="ticket-registrations-area">
							<h4 class="sub-section-title"><img class="icon" src="<?php echo EE_IMAGES_URL.'users-16x16.png';?>"><?php echo __("Registration Details", "event_espresso");?> <span class="small-text link">[ <a class="print_button noPrint" href="<?php echo $edit_reg_info_url; ?>"><?php _e('edit', 'event_espresso'); ?></a> ]</span></h4>
							<ul class="ticket-registrations-list">
								<?php $ii = 0;?>
								<?php foreach($registrations_per_line_item[$line_item_id] as $registration){
								//var_dump($registration);			
								if($ii >= 1) {continue;}
								$ii++;?>
								<li class="ticket-registration">
									<table class="registration-details">
										<tr class="odd">
											<th><?php echo 	_e("Registration Code:", "event_espresso");?></th>
											<td><?php echo $registration->reg_code();?> - <span class="<?php echo $registration->status_ID()?>"><?php echo $registration->pretty_status()?></span></td>
										</tr>
										<?php
										foreach($event->question_groups() as $question_group){
											?><tr><th><?php $question_group->e('QSG_name');?></th><td></td></tr><?php
											$has_personal_info = false;
											foreach($question_group->questions() as $question){
												if( in_array($question->ID(),$questions_to_skip)){
													$has_personal_info = true;
													continue;
												}
												?><tr>
														<th><?php echo $question->display_text()?></th>
														<td><?php echo $registration->answer_value_to_question($question);?></td>
												</tr><?php
											}
											if($has_personal_info){
												?><tr><th><?php	_e('Attendee', 'event_espresso');?></th><td><?php echo sprintf(__('%s (%s)', "event_espresso"),$attendee->full_name(),$attendee->email())?></td></tr><?php
											}
										}
										?>

I want it to have the ticket details and the primary registrant’s name only.

Also, note that my receipts are formatted the same way (https://teens.artsconnection.org/thank-you/?ee=launch_invoice&id=1-bc7862f4c52de2c1a2894ce224ce690e&html=1&receipt=true) as my Registration page, with ticket types inside attendee divs, which I described in this thread:
https://eventespresso.com/topic/multiple-ticket-types-displayed-on-single-checkout-page/#post-125003


Dean

October 29, 2014 at 5:55 am

Hi,

It looks like you’re missing a bit of code.

Compare yours to what I have pasted here http://pastebin.com/FVVzMdw7 specifically around line 133, looks like lines 138-140 are the ones missing.


Michael

October 29, 2014 at 6:32 am

Dean, thank you, but the output of this is the same as the default: 1)there is an attendee section for each ticket sold, and 2)ticket types don’t appear in the same list–the second ticket type sold is inside the second attendee section.


Dean

October 29, 2014 at 7:25 am

Hi,

This is what I see before the code change: http://take.ms/frgK8 and after http://take.ms/hRZ7k

So it has removed the additional attendees from the invoice. Was that not what you were after?

  • This reply was modified 10 years, 1 month ago by Dean. Reason: typo


Michael

October 29, 2014 at 7:38 am

Dean, that is exactly what I want, but it doesn’t happen for me. I still see all attendees. I have verified that I am editing the correct file and that changes that I make are reflected in the output.

Could it be that since the Primary Registrant=Additional Attendees, it is still being listed once for each ticket? I am registering all attendees using the primary’s information (which is why I don’t want to show the other attendees.) When you tested, did you register other attendees, or did you apply Primary to all?


Michael

October 29, 2014 at 7:39 am

Here is my file: http://pastebin.com/mFHAT8ke


Dean

October 30, 2014 at 3:14 am

Hi Michael,

I added your code to my EE (4.4.3) and the only change I made was to uncomment the code I added (otherwise it wont work).

I then registered an event for 5 people (only taking the Primary attendee data no one elses) and it still worked: http://take.ms/KNLGF

I then tested where the additional attendees data WAS requested, but the Primary attendees details were inserted (by ticking the box). The Order Confirmation Receipt still showed only the primary attendee.


Michael

October 30, 2014 at 6:39 am

OK, this sounds promising. Can you please show me the parts you uncommented? Thank you


Michael

November 4, 2014 at 6:13 am

Hi Dean, I wasn’t able to figure this out. Can you let me know which lines you uncommented? Thanks


Dean

November 4, 2014 at 7:15 am

Hi,

Sorry for the late response.

Here’s a screenshot of your code from the pastebin. The 3 arrows show which lines I uncommented (the original code modifications I made) – that’s lines 120, 123 and 124 – screenshot http://take.ms/6RDEO

Leave line 122 commented out, otherwise you will get debugging information on your website.


Michael

November 4, 2014 at 8:09 am

Ah, shows what I know. The debug line was holding me up.

Works great, thanks a lot. Much appreciated.

Viewing 14 reply threads

The support post ‘Invoice-Primary Registrant only’ 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