Filter
rpress_customer_recount_sholud_increase_value
On this page
Filters whether a payment's amount is added to the customer's recalculated purchase value.
Runs for each payment that passed rpress_customer_recount_should_process_payment during a customer stats recalculation. The default is true. Returning false leaves the payment amount out of the customer's lifetime value while the payment can still be counted by the order count filter.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$increase | bool | Whether to add the payment amount. Default true. |
$payment | WP_Post | The payment post being evaluated. |
Return value#
bool. True to add the amount to the purchase value.
Example#
function my_recount_increase_value( $increase, $payment ) {
if ( 'revoked' === $payment->post_status ) {
return false;
}
return $increase;
}
add_filter( 'rpress_customer_recount_sholud_increase_value', 'my_recount_increase_value', 10, 2 );
Notes#
The hook name contains a typo (sholud) and must be used exactly as written. Fired from RPRESS_Tools_Recount_Customer_Stats and RPRESS_Tools_Recount_Single_Customer_Stats.
Source#
Applied in:
includes/admin/tools/class-rpress-tools-recount-customer-stats.php(line 86), inRPRESS_Tools_Recount_Customer_Stats::get_data()includes/admin/tools/class-rpress-tools-recount-single-customer-stats.php(line 68), inRPRESS_Tools_Recount_Single_Customer_Stats::get_data()
See also#
Was this page helpful?
