Skip to content
Docs
Get RestroPress

Filter

rpress_payment_discounted_amount

Updated
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#

ParameterTypeDescription
$discounted_amountfloatTotal minus fees and tax.
$paymentRPRESS_PaymentThe 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 2202), in RPRESS_Payment::get_discounted_amount()

See also#

Was this page helpful?