From: Eileen McNaughton Date: Tue, 28 Nov 2023 22:03:02 +0000 (+1300) Subject: Get currency from the event X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=89ad28f87609b9f5a4490db3dc5e4f584793bdb3;p=civicrm-core.git Get currency from the event --- 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. *