Filter
rpress_payment_discounted_amount
On this page
Filters the discounted amount of a payment (total minus fees and tax).
Applied when the discounted_amount property of an RPRESS_Payment is read. The default is the payment total minus the total of fees and tax, and the filtered result is cast to float.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discounted_amount | float | Total minus fees and tax. |
$payment | RPRESS_Payment | The payment object. |
Return value#
float. The discounted amount.
Example#
function my_payment_discounted_amount( $discounted_amount, $payment ) {
return max( 0, $discounted_amount );
}
add_filter( 'rpress_payment_discounted_amount', 'my_payment_discounted_amount', 10, 2 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 2205), inRPRESS_Payment::get_discounted_amount()
See also#
Was this page helpful?
