Skip to content

Commit

Permalink
Do the todo (move the function to the trait as suggested
Browse files Browse the repository at this point in the history
This makes the currency of the contribution available to the template
for other templates - notably offline event receipts
  • Loading branch information
eileenmcnaughton committed Aug 12, 2023
1 parent 96b3fa3 commit 4789cb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
12 changes: 0 additions & 12 deletions CRM/Contribute/WorkflowMessage/ContributionInvoiceReceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,4 @@ class CRM_Contribute_WorkflowMessage_ContributionInvoiceReceipt extends GenericW

public const WORKFLOW = 'contribution_invoice_receipt';

/**
* Specify any tokens that should be exported as smarty variables.
*
* @todo it might be that this should be moved to the trait as we
* we work through these.
*
* @param array $export
*/
protected function exportExtraTokenContext(array &$export): void {
$export['smartyTokenAlias']['currency'] = 'contribution.currency';
}

}
9 changes: 9 additions & 0 deletions CRM/Contribute/WorkflowMessage/ContributionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,13 @@ protected function exportExtraTplParams(array &$export): void {
$export['isShowTax'] = (bool) Civi::settings()->get('invoicing');
}

/**
* Specify any tokens that should be exported as smarty variables.
*
* @param array $export
*/
protected function exportExtraTokenContext(array &$export): void {
$export['smartyTokenAlias']['currency'] = 'contribution.currency';
}

}

0 comments on commit 4789cb7

Please sign in to comment.