Skip to content
Docs
Get RestroPress

Filter

rpress_decrease_customer_purchase_count_on_refund

Updated
On this page

Filters whether a refund reduces the customer's purchase count.

Applied in RPRESS_Payment::process_refund after rpress_pre_refund_payment and passed to maybe_alter_stats. Return false to leave the customer's purchase count unchanged when a payment is refunded.

Parameters#

ParameterTypeDescription
$decreaseboolTrue to reduce the value. The default is true.
$paymentRPRESS_PaymentThe payment being refunded.

Return value#

bool. Whether to reduce the value.

Example#

function my__decrease_customer_purchase_count_on_refund( $decrease, $payment ) {
	return false;
}
add_filter( 'rpress_decrease_customer_purchase_count_on_refund', 'my__decrease_customer_purchase_count_on_refund', 10, 2 );

Source#

Applied in:

  • includes/payments/class-rpress-payment.php (line 1657), in RPRESS_Payment::process_refund()

See also#

Was this page helpful?