Action
rpress_customer_post_increase_purchase_count
On this page
Fires after a customer's purchase count is increased.
Fires in RPRESS_Customer::increase_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 increased by. |
$customer_id | int | The customer ID. |
$customer | RPRESS_Customer | The customer object. |
Example#
function my_customer_post_increase_purchase_count( $purchase_count, $count, $customer_id, $customer ) {
if ( $purchase_count >= 10 ) {
update_option( 'my_vip_customer_' . $customer_id, 1 );
}
}
add_action( 'rpress_customer_post_increase_purchase_count', 'my_customer_post_increase_purchase_count', 10, 4 );
Source#
Fired from:
includes/class-rpress-customer.php(line 456), inRPRESS_Customer::increase_purchase_count()
See also#
Was this page helpful?
