Action
rpress_receipt_after_tax_row
On this page
Fires after the tax row in the order receipt totals.
Runs in the receipt template, directly after the tax row, only when taxes are enabled. Use it to print extra rows such as a per-class tax breakdown. The row markup in the receipt uses a div with the class rp-track-total-row containing two spans.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_id | int | Order ID, passed as $payment->ID. |
$arg2 | string | Context, always receipt in this template. |
Example#
function my_receipt_after_tax_row( $payment_id, $context ) {
$note = get_post_meta( $payment_id, '_my_tax_note', true );
if ( $note ) {
echo '<div class="rp-track-total-row"><span>' . esc_html__( 'Tax note', 'my-plugin' ) . '</span><span>' . esc_html( $note ) . '</span></div>';
}
}
add_action( 'rpress_receipt_after_tax_row', 'my_receipt_after_tax_row', 10, 2 );
Notes#
The second argument is a literal string (receipt), not a variable.
Source#
Fired from:
templates/shortcode-receipt.php(line 319)
See also#
Was this page helpful?
