# Codex Prompt — PHSG “My Account” Dashboard UX (WooCommerce)

You’re working in a Roots Bedrock WordPress site (WooCommerce + Woo Subscriptions + Woo Memberships) with custom FYD plugins, including `fyd/phsg-membership-account-ux`. Implement a more custom, member-friendly “My Account” experience and dashboard.

## Goal
Update the WooCommerce My Account area so it feels less like “stock WooCommerce” and more like a purpose-built member portal for:
- Paying dues (membership/subscription)
- Registering for meetings/events
- Making donations + seeing donation progress and lifetime giving level

Match the general layout/polish of the attached inspiration (ASSH dashboard): simple stat tiles + a “My Donations” card showing donation level and totals.

## Key Requirements

### 1) Left Nav Updates
In the My Account navigation menu:
- Hide/remove the “Subscriptions” link entirely (members can access subscription info via Orders).
- Rename the “Orders” link label to **“Orders History”** (keep the endpoint, only change label).

### 2) Dashboard Content (My Account landing)
Replace/augment the default Woo dashboard (“From your account dashboard you can view…”) with custom cards/tiles.

#### A) Donation Summary Card (primary)
Add a “My Donations” card with:
- **Lifetime Total Given** (currency formatted)
- **Current Lifetime Giving Level** label (see levels below)
- A **progress indicator** to the *next* level (optional but preferred) including:
  - amount toward next tier (e.g. $6,550 of $10,000)
  - amount remaining
- CTA buttons:
  - “Make a Donation”
  - “Donation History” (link to My Account orders filtered to donation products OR a dedicated endpoint if we already have one)

**Lifetime Giving Levels**
- $1,000 – Trigger thumb
- $2,500 – Polydactyly
- $5,000 – Syndactyly
- $10,000 – Hypoplastic thumb
- $50,000 – Mirror Hand

Rules:
- Determine the member’s lifetime total donations and map to the highest tier achieved.
- If total < $1,000, show something like “Supporter” (or “Not yet at a level”) and show next tier = $1,000.
- If total >= $50,000, show “Mirror Hand” and omit “next tier” progress.

Data source (choose best available):
- Prefer an existing plugin/helper if present (check `fyd/donation-receipts` and `fyd/phsg-membership-account-ux`).
- Otherwise compute from Woo orders:
  - Paid/completed/processing orders only
  - Sum line items that represent donation products (how to detect: product category “donation”, product tag “donation”, or a product meta flag — find what exists and use the most reliable method).
  - Exclude refunded/cancelled/failed orders and refunded line items.

#### B) Additional Member Tiles (optional but desired)
Add 2–3 compact stat tiles above cards (similar to the inspiration):
- “Membership Status” (Active / Expiring Soon) + renewal date if available
- “Meeting Registrations” count OR “Upcoming Meeting” summary (if event tickets data is accessible)
- “CME Activities” is optional; if not applicable to PHSG, replace with “Orders”, “Resources”, or “Downloads”

Only implement what you can confidently pull from existing data. If uncertain, stub the UI with placeholders and TODO comments.

### 3) Styling / UX
- Keep it consistent with PHSG branding (orange accents).
- Reduce “stock Woo” look:
  - Use a card layout with clean spacing, subtle borders, and clear headings.
  - Replace the default Woo dashboard paragraph with structured content.
- Ensure it’s responsive.

## Implementation Notes
- Implement as a small, maintainable customization:
  - Prefer doing this inside `fyd/phsg-membership-account-ux` plugin if it’s intended for this, otherwise use a child/custom plugin or theme overrides.
- Use Woo hooks where possible:
  - `woocommerce_account_menu_items` to modify nav items
  - `woocommerce_account_dashboard` to render custom dashboard content (or override `myaccount/dashboard.php` if appropriate)
- Avoid hardcoding URLs; use Woo endpoints and WP functions.

## Deliverables
1) Code changes implementing nav updates and the new dashboard UI.
2) Any helper functions/classes to compute:
   - lifetime donation total
   - current giving level + next level + progress
3) Notes in comments explaining:
   - how donation products are detected
   - which order statuses are counted
4) Quick manual test checklist in a comment:
   - member with $0 donations
   - member between tiers
   - member above $50k tier
   - refunded donation order excluded properly
   - subscriptions menu item removed
   - orders label shows “Orders History”

## Constraints
- Don’t break existing My Account endpoints.
- Keep it straightforward and readable (this will be maintained by FYD).
- If you find an existing donation helper in the codebase, use it rather than re-inventing.

Start by searching the codebase for anything related to:
- “donation”
- “donation receipts”
- “phsg-membership-account-ux”
- Woo my account customizations
Then implement the changes.
