=== WooCommerce Customer Export (Batched) ===
Contributors: inspired
Tags: woocommerce, customers, export, csv
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later

Export every WooCommerce customer (registered and guest) to CSV, in batches, so large stores never time out.

== Description ==

Exports one row per customer with:

* Customer ID and type (Registered / Guest)
* First name, last name, email
* Total spend (order totals minus refunds, for the statuses you choose)
* Number of orders, first and last order date
* Billing address and shipping address, both as a single formatted line and as separate columns (name, company, address 1/2, city, state, postcode, country, phone)

Customers are identified by their WordPress user account when they have one, otherwise by billing email, so guest checkouts are grouped correctly. Name and address come from the customer's most recent order.

Works with both the classic posts order storage and High-Performance Order Storage (HPOS).

== Usage: admin screen ==

WooCommerce > Customer Export. Choose which order statuses count, click Start export and keep the tab open. The page makes one short request per batch (250 orders by default), so it never hits the PHP time limit. If a request fails it retries automatically; if you close the tab you can come back and click Resume. When it finishes, click Download CSV.

== Usage: WP-CLI (best for very large stores) ==

    wp wcce export --file=/path/to/customers.csv

Options:

* `--statuses=completed,processing`  Order statuses to count (default: completed,processing)
* `--batch=500`                      Orders per batch
* `--skip-users`                     Leave out registered customers with no qualifying orders
* `--no-progress`                    Plain log output (for cron)

Also: `wp wcce status`, `wp wcce reset`.

== Filters ==

* `wcce_default_statuses`  Default statuses array
* `wcce_order_spend`       Adjust the amount counted for an order (receives float, WC_Order)
* `wcce_user_roles`        Roles treated as customers when adding no-order accounts (default: customer)
* `wcce_csv_columns`       Header row
* `wcce_csv_row`           Each data row (receives row array, DB row)

== Changelog ==

= 1.0.0 =
* Initial release.
