Action
rpress_customer_post_decrease_purchase_count
On this page
Fires after a customer's purchase count is decreased.
Fires in RPRESS_Customer::decrease_purchase_count() after the update attempt. The first argument is the object's current purchase count, which is unchanged if the update failed.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$purchase_count | int | The customer's purchase count after the change. |
$count | int | The amount the purchase count was decreased by. |
$customer_id | int | The customer ID. |
$customer | RPRESS_Customer | The customer object. |
Example#
function my_customer_post_decrease_purchase_count( $purchase_count, $count, $customer_id, $customer ) {
if ( 0 === (int) $purchase_count ) {
delete_option( 'my_vip_customer_' . $customer_id );
}
}
add_action( 'rpress_customer_post_decrease_purchase_count', 'my_customer_post_decrease_purchase_count', 10, 4 );
Source#
Fired from:
includes/class-rpress-customer.php(line 479), inRPRESS_Customer::decrease_purchase_count()
See also#
Was this page helpful?
