From 89ad28f87609b9f5a4490db3dc5e4f584793bdb3 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 29 Nov 2023 11:03:02 +1300 Subject: [PATCH] Get currency from the event --- CRM/Event/Form/Participant.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 2d846e9934..d5c7502ef8 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1244,12 +1244,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $form->_pId = CRM_Utils_Request::retrieve('participantId', 'Positive', $form); $form->_discountId = CRM_Utils_Request::retrieve('discountId', 'Positive', $form); - //CRM-6907 set event specific currency. - if ($form->_eventId && - ($currency = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'currency')) - ) { - CRM_Core_Config::singleton()->defaultCurrency = $currency; - } if ($form->_eventId) { $form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary'); if ($form->_isPaidEvent) { @@ -1486,6 +1480,15 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $this->assign('event', ['confirm_email_text' => $receiptText]); } + /** + * Get the currency for the event. + * + * @return string + */ + public function getCurrency() { + return $this->getEventValue('currency') ?: \Civi::settings()->get('defaultCurrency'); + } + /** * Process the contribution. * -- 2.25.1