Filter
rpress_decrease_customer_purchase_count_on_refund
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#
| Parameter | Type | Description |
|---|---|---|
$decrease | bool | True to reduce the value. The default is true. |
$payment | RPRESS_Payment | The 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), inRPRESS_Payment::process_refund()
See also#
Was this page helpful?
