From 360a56167650902ecd6fe0b772a4a74c723731f7 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 18 Sep 2023 16:07:30 +1200 Subject: [PATCH] Fix multiple participant online receipt display for quickConfig --- CRM/Event/Form/Registration/Confirm.php | 1 + .../event_online_receipt_html.tpl | 27 +++++++++++-------- .../event_online_receipt_text.tpl | 9 +++++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 30161be569..acf7eb0724 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -896,6 +896,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $params = $this->get('params'); $amount[$participantNum]['label'] = preg_replace('//', '', $params[$participantNum]['amount_level']); $amount[$participantNum]['amount'] = $params[$participantNum]['amount']; + // @todo - unused in core offline receipt template from 5.67. Remove at somepoint $this->assign('amounts', $amount); } if ($this->_lineItem) { diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index fa44cb0588..779e17cd2f 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -244,6 +244,22 @@ {/if} {/foreach} {/if} + {if !$isShowLineItems} + {foreach from=$participants key=index item=currentParticipant} + {if $isPrimary || {participant.id} === $currentParticipant.id} + {foreach from=$currentParticipant.line_items key=index item=currentLineItem} + + + {$currentLineItem.label} {if $isPrimary} - {$currentParticipant.contact.display_name}{/if} + + + {$currentLineItem.line_total|crmMoney:$currency} + + + {/foreach} + {/if} + {/foreach} + {/if} {if $isShowTax && {contribution.tax_amount|boolean}} @@ -264,17 +280,6 @@ {/foreach} {/if} - - {if !empty($amounts) && empty($lineItem)} - {foreach from=$amounts item=amnt key=level} - - - {$amnt.amount|crmMoney:$currency} {$amnt.label} - - - {/foreach} - {/if} - {if $isShowTax && {contribution.tax_amount|boolean}} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index c17e7f971d..f600ae5ebb 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -131,8 +131,13 @@ You were registered by: {$payer.name} {/if} {/if} -{if !empty($amounts) && empty($lineItem)} -{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} +{if !$isShowLineItems} +{foreach from=$participants key=index item=currentParticipant} +{if $isPrimary || {participant.id} === $currentParticipant.id} +{foreach from=$currentParticipant.line_items key=index item=currentLineItem} +{$currentLineItem.label} {if $isPrimary} - {$currentParticipant.contact.display_name}{/if} - {$currentLineItem.line_total|crmMoney:$currency} +{/foreach} +{/if} {/foreach} {/if} -- 2.25.1