From ea93110b2590c61001cf960307fd5ea1c127f051 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 18 Oct 2019 14:32:48 +1300 Subject: [PATCH] Fix Event online receipts to display credit card info if available. We currently have a very complex IF clause which includes some deprecated parameters. However, we can simplify this to simply display the information if availble. We only collect credit card information if we require it & hence the presence of it is an adequate indicator as to whether to display it. We could check for credit_card_number instead but actually there is precedent in another tpl for checking credit_card_type & it's pretty neutral as both should be present or missing --- tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php | 3 +++ xml/templates/message_templates/event_online_receipt_html.tpl | 2 +- xml/templates/message_templates/event_online_receipt_text.tpl | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index 36a5b5fe59..358389669a 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -209,6 +209,9 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { ], $entityFinancialTrxns[2], ['id', 'entity_id']); $mut->checkMailLog([ 'Event Information and Location', 'Registration Confirmation - Annual CiviCRM meet', + 'Expires: January 2019', + 'Visa', + '************1111', 'This letter is a confirmation that your registration has been received and your status has been updated to Registered', ]); $mut->clearMessages(); diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 1a663b4ce1..f3431df855 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -410,7 +410,7 @@ {/if} - {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval} + {if $credit_card_type} {ts}Credit Card Information{/ts} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index 2ec59a512f..93d7341a68 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -211,7 +211,7 @@ You were registered by: {$payer.name} {$address} {/if} -{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval} +{if $credit_card_type} ==========================================================={if $pricesetFieldsCount }===================={/if} {ts}Credit Card Information{/ts} -- 2.25.1