Skip to content
Docs
Get RestroPress

Action

rpress_customer_post_increase_purchase_count

Updated
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#

ParameterTypeDescription
$purchase_countintThe customer's purchase count after the change.
$countintThe amount the purchase count was increased by.
$customer_idintThe customer ID.
$customerRPRESS_CustomerThe 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), in RPRESS_Customer::increase_purchase_count()

See also#

Was this page helpful?