This makes the currency of the contribution available to the template
for other templates - notably offline event receipts
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';
- }
-
}
$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';
+ $export['smartyTokenAlias']['taxTerm'] = 'domain.tax_term';
+ }
+
}
protected function exportExtraTokenContext(array &$export): void {
// Tax term is exposed at the generic level as so many templates use it
// (e.g. Membership, participant, pledge as well as contributions).
+ // However, these basically now all implement the ContributionTrait so we
+ // can hopefully remove from here (after some checking).
$export['smartyTokenAlias']['taxTerm'] = 'domain.tax_term';
}