Skip to content
Docs
Get RestroPress

Action

rpress_customer_post_decrease_value

Updated
On this page

Fires after a customer's lifetime value is decreased.

Fires in RPRESS_Customer::decrease_value() after the update attempt. The first argument is the object's current purchase value, which is unchanged if the update failed.

Parameters#

ParameterTypeDescription
$purchase_valuefloatThe customer's lifetime value after the change.
$valuefloatThe amount that was subtracted.
$customer_idintThe customer ID.
$customerRPRESS_CustomerThe customer object.

Example#

function my_customer_post_decrease_value( $purchase_value, $value, $customer_id, $customer ) {
	update_option( 'my_customer_ltv_' . $customer_id, $purchase_value );
}
add_action( 'rpress_customer_post_decrease_value', 'my_customer_post_decrease_value', 10, 4 );

Source#

Fired from:

  • includes/class-rpress-customer.php (line 516), in RPRESS_Customer::decrease_value()

See also#

Was this page helpful?