Skip to content
Docs
Get RestroPress

Action

rpress_customer_pre_decrease_purchase_count

Updated
On this page

Fires before a customer's purchase count is decreased.

Fires in RPRESS_Customer::decrease_purchase_count() after the amount has been validated, before the purchase_count column is updated. The new total is floored at zero.

Parameters#

ParameterTypeDescription
$countintThe amount the purchase count is decreased by.
$customer_idintThe customer ID.
$customerRPRESS_CustomerThe customer object.

Example#

function my_customer_pre_decrease_purchase_count( $count, $customer_id, $customer ) {
	error_log( 'Customer ' . $customer_id . ' count -' . $count );
}
add_action( 'rpress_customer_pre_decrease_purchase_count', 'my_customer_pre_decrease_purchase_count', 10, 3 );

Source#

Fired from:

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

See also#

Was this page helpful?