You appear to be a bot. Output may be restricted
Description
Zero out the data on step one
Usage
$void = EDD_Tools_Recount_Single_Customer_Stats::pre_fetch();
Parameters
Returns
void
Source
File name: easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-single-customer-stats.php
Lines:
1 to 37 of 37
public function pre_fetch() { if ( $this->step === 1 ) { $allowed_payment_status = apply_filters( 'edd_recount_customer_payment_statuses', edd_get_payment_status_keys() ); // Before we start, let's zero out the customer's data $customer = new EDD_Customer( $this->customer_id ); $customer->update( array( 'purchase_value' => edd_format_amount( 0 ), 'purchase_count' => 0 ) ); $attached_payment_ids = explode( ',', $customer->payment_ids ); $attached_args = array( 'post__in' => $attached_payment_ids, 'number' => -1, 'status' => $allowed_payment_status, ); $attached_payments = edd_get_payments( $attached_args ); $unattached_args = array( 'post__not_in' => $attached_payment_ids, 'number' => -1, 'status' => $allowed_payment_status, 'meta_query' => array( array( 'key' => '_edd_payment_user_email', 'value' => $customer->email, ) ), ); $unattached_payments = edd_get_payments( $unattached_args ); $payments = array_merge( $attached_payments, $unattached_payments ); $this->store_data( 'edd_recount_customer_payments_' . $customer->id, $payments ); } }