From 3f76b85fb12d4c4c4a1b6c22f98439f18ff9b937 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 9 Jun 2023 13:11:32 +0100 Subject: [PATCH] Fix don't display payment fields on initial event registration form if payment on confirm is enabled --- CRM/Event/Form/Registration.php | 1 + templates/CRM/Event/Form/Registration/Register.tpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 0719a563cc..7d72631737 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -218,6 +218,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { $this->_additionalParticipantIds = $this->get('additionalParticipantIds'); $this->showPaymentOnConfirm = (in_array($this->_eventId, \Civi::settings()->get('event_show_payment_on_confirm')) || in_array('all', \Civi::settings()->get('event_show_payment_on_confirm'))); + $this->assign('showPaymentOnConfirm', $this->showPaymentOnConfirm); if (!$this->_values) { // this is the first time we are hitting this, so check for permissions here diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index f8c1a325dd..660bdd0f66 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -132,7 +132,7 @@ {/if} - {if $priceSet} + {if $priceSet && !$showPaymentOnConfirm} {include file='CRM/Core/BillingBlockWrapper.tpl'} {/if} -- 2.25.1