WC_Report_Customer_List::output_report()publicWC 1.0

Output the report.

Method of the class: WC_Report_Customer_List{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Report_Customer_List = new WC_Report_Customer_List();
$WC_Report_Customer_List->output_report();

WC_Report_Customer_List::output_report() code WC 8.7.0

public function output_report() {
	$this->prepare_items();

	echo '<div id="poststuff" class="woocommerce-reports-wide">';

	if ( ! empty( $_GET['link_orders'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'link_orders' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
		$linked = wc_update_new_customer_past_orders( absint( $_GET['link_orders'] ) );
		/* translators: single or plural number of orders */
		echo '<div class="updated"><p>' . sprintf( esc_html( _n( '%s previous order linked', '%s previous orders linked', $linked, 'woocommerce' ), $linked ) ) . '</p></div>';
	}

	if ( ! empty( $_GET['refresh'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'refresh' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
		$user_id = absint( $_GET['refresh'] );
		$user    = get_user_by( 'id', $user_id );

		delete_user_meta( $user_id, '_money_spent' );
		delete_user_meta( $user_id, '_order_count' );
		delete_user_meta( $user_id, '_last_order' );
		/* translators: User display name */
		echo '<div class="updated"><p>' . sprintf( esc_html__( 'Refreshed stats for %s', 'woocommerce' ), esc_html( $user->display_name ) ) . '</p></div>';
	}

	echo '<form method="post" id="woocommerce_customers">';

	$this->search_box( __( 'Search customers', 'woocommerce' ), 'customer_search' );
	$this->display();

	echo '</form>';
	echo '</div>';
}