=== CellarClub ===
Contributors: hexcorp
Tags: wine club, woocommerce, membership, winery, subscription
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Run a wine, cider or spirits club on WooCommerce: tiers, card on file, member pricing, releases, batch charging and 21+ checks.

== Description ==

Wine clubs are a winery's biggest direct-to-consumer revenue line, and the software that runs them charges a percentage of every shipment. CellarClub runs a modern club on the WooCommerce store you already have, for free:

* **Club tiers**: name, bottles per shipment, shipments per year, member discount, shipping discount, pick-up option, optional signup fee.
* **Signup block** (`[cellarclub_signup]`): choose a tier, confirm you are 21+ (date of birth), enter the shipping address with a live "can we ship there?" check, pick up or ship, then save a card through your WooCommerce payment gateway. No fee: the card is saved on the *Add payment method* page; with a fee: the member pays a signup order and the card is kept.
* **Member pricing applied automatically** in the store: the tier's discount on every product (struck-through store price, "Member price" label) and on shipping rates. Products can opt out.
* **Member portal block** (`[cellarclub_portal]`): upcoming shipments with the bottles and totals, history with order links, update the card, update the address, pick-up vs ship (default and per shipment).
* **Shipment builder**: per release, define the default package per tier by searching your products. Prepare one shipment per member, adjust individual members' bottles, switch delivery.
* **Batch processing**: charge every member for a release in background chunks (Action Scheduler), creating a WooCommerce order per member with member pricing, club shipping and the same tax WooCommerce would charge, charging the card on file, logging every attempt and reporting failures. Stripe cards are charged with a confirmed off-session PaymentIntent and a per-attempt idempotency key; when a bank asks for 3-D Secure the member gets a pay link instead of a blind retry. Re-charge one member, hold, skip or cancel, mark shipped with tracking, mark picked up.
* **Fulfilment**: download a shipping CSV for your fulfilment house (one column per SKU, adult-signature flag), print a pick list, packing slips and pick-up slips, and import tracking numbers from a CSV to mark boxes shipped and email members.
* **Heat and weather holds**: list states and the date you will ship to them again. Paid boxes stay off the shipping list until then; members are told once and can switch to pick-up.
* **Send one box elsewhere**: members (and staff) can send a single shipment to another address, checked against your shipping rules, without changing their usual address.
* **Gift memberships**: the giver chooses a tier and the number of shipments, adds a message and pays for each shipment as it goes out; the recipient gets a welcome and a set-password link, and the gift ends on its own.
* **Getting started**: a checklist on the club dashboard checks your real setup (payments, tiers, states, pages, emails, first release), and CellarClub → Guide explains every task in plain language.
* **Member emails**: welcome, release open (with the package and the cut-off), cut-off reminder, shipment charged, shipped with a tracking link, payment failed, "please confirm your payment", shipping hold, gift welcome, gift receipt and gift ended. Every email is a template with a "send me a test" button; an empty subject turns it off.
* **Import and export**: bring members over from another platform with a CSV import (dry run first, invites with a set-password and add-a-card link), export members as CSV, and change tier, status or delivery for many members at once.
* **Members-only products** and **allocation-only releases**: a product can be limited to members, to specific tiers, or to the members of a release while it is open.
* **Compliance layer**: CellarClub never decides shipping legality in code. A hook-based adapter interface (ShipCompliant-style `check` / `commit`) answers "may this ship?" for every signup, checkout and club shipment; a manual allowed-states list is the fallback; 21+ age verification runs at signup and at WooCommerce checkout (classic and block).
* **Club Tiers block** for a pricing table, WooCommerce *My Account* link, HPOS compatible, REST API (`cellarclub/v1`) with a capability check on every route, a Club Staff role, WP-CLI (`wp cellarclub seed|charge|sweep|status`).

**Everything in the free plugin works without limits. No locked features, no nags.**

= Charging cards on file =

WooCommerce has no single off-session charge API. The default "automatic" charger picks per card: an off-session PaymentIntent through the official WooCommerce Stripe gateway's own API client for Stripe cards, the renewal hook (`woocommerce_scheduled_subscription_payment_{gateway}`) for gateways that implement it, and the gateway's saved-token checkout path for everything else. You can also force one strategy, or turn automatic charging off so members pay by link. A gateway plugin can take over through the `cellarclub_charge_shipment` filter.

= Add-on =

[CellarClub Pro](https://hexcorp.io/cellarclub) adds customisable shipments (swap or add bottles before the cut-off within your rules), failed-payment recovery with a retry schedule and card-update emails, pick-up party mode with a check-in list, allocation lists with tiered priority windows and purchase limits, hold / skip / pause and a cancellation flow with a retention offer, a tasting-room kiosk for enrolling members on a tablet, reports, and a ShipCompliant adapter.

== Installation ==

1. Install and activate WooCommerce, then CellarClub.
2. Enable a payment gateway that can save cards (WooCommerce → Payments).
3. Create your tiers under **CellarClub → Tiers**.
4. Under **CellarClub → Settings**, set the allowed states (or install a compliance adapter), club shipping, and pick the signup and portal pages.
5. Add the **Club Signup** and **Member Portal** blocks to those pages (or the shortcodes).
6. Create a release, set the default package per tier, prepare and charge.

Run `wp cellarclub seed --reset` for a complete demo winery.

== Frequently Asked Questions ==

= Does CellarClub decide which states I can ship to? =

No. It asks a compliance adapter and records the answer. Out of the box the adapter is a manual list you maintain; a provider adapter can replace it through the `cellarclub_compliance_adapter` filter. Your licensing and your compliance provider decide; CellarClub enforces.

= Which payment gateways work? =

Any WooCommerce gateway that supports saved payment methods (tokenization) — Stripe, Braintree, Square, Authorize.net, PayPal and others. See Settings → Charging for the strategy.

= Is it compatible with High-Performance Order Storage? =

Yes. Club orders are created through the WooCommerce CRUD API only.

== Screenshots ==

1. Club tiers and the signup block.
2. The member portal: upcoming shipment with member prices, card on file, address, pick-up or ship.
3. A release: default package per tier and the prepared shipments.
4. Members, with import, export and bulk actions.
5. The club dashboard.
6. Age gate and compliance settings.
7. The signup form refusing a state that is not on the allowed list.

== Changelog ==

= 1.0.0 =
* First release, tested for WCAG 2.1 AA with axe-core on every member and admin screen.
