Issue 1 - Dashboard > Overview Never Active: Added debug logging to investigate why Overview submenu never shows active - Console logs path, pathname, and isActive state - Will help identify the root cause Issue 2 - Guest Wishlist Public Page: Problem: Guests couldn't access wishlist (redirected to login) Solution: Created public /wishlist route accessible to all users Implementation: 1. New Public Wishlist Page: - Route: /wishlist (not /my-account/wishlist) - Accessible to guests and logged-in users - Guest mode: Shows product IDs from localStorage - Logged-in mode: Shows full product details from API - Guests can view and remove items 2. Updated All Header Links: - ClassicLayout: /wishlist - ModernLayout: /wishlist - BoutiqueLayout: /wishlist - No more wp-login redirect for guests 3. Guest Experience: - See list of wishlisted product IDs - Click to view product details - Remove items from wishlist - Prompt to login for full details Issue 3 - Wishlist Page Selector Setting: Status: Deprecated/unused for SPA architecture - SPA uses React Router, not WordPress pages - Setting saved but has no effect - Shareable wishlist would also be SPA route - No need for page CPT selection Files Modified: - customer-spa/src/pages/Wishlist.tsx (new public page) - customer-spa/src/App.tsx (added /wishlist route) - customer-spa/src/hooks/useWishlist.ts (export productIds) - customer-spa/src/layouts/BaseLayout.tsx (all themes use /wishlist) - customer-spa/dist/app.js (rebuilt) - admin-spa/src/components/nav/SubmenuBar.tsx (debug logging) - admin-spa/dist/app.js (rebuilt) Result: ✅ Guests can access wishlist page ✅ Guests can view and manage localStorage wishlist ✅ No login redirect for guest wishlist ✅ Debug logging added for Overview issue
WooNooW Customer SPA
Modern React-based storefront and customer portal for WooNooW.
Features
- Product Catalog - Browse products with filters and search
- Shopping Cart - Add to cart with real-time updates
- Checkout - Single-page checkout with address autocomplete
- My Account - Order history, profile, and addresses
- Mobile-First - Responsive design for all devices
- PWA Ready - Offline support and app-like experience
Development
# Install dependencies
npm install
# Start dev server (https://woonoow.local:5174)
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lint
Project Structure
customer-spa/
├── src/
│ ├── pages/ # Page components (Shop, Cart, Checkout, Account)
│ ├── components/ # Reusable UI components
│ ├── lib/
│ │ ├── api/ # API client and endpoints
│ │ ├── cart/ # Cart state management (Zustand)
│ │ ├── checkout/ # Checkout logic
│ │ └── tracking/ # Analytics and pixel tracking
│ ├── hooks/ # Custom React hooks
│ ├── contexts/ # React contexts
│ └── types/ # TypeScript type definitions
├── public/ # Static assets
└── dist/ # Build output (generated)
Tech Stack
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool
- React Router - Routing
- TanStack Query - Data fetching
- Zustand - State management
- TailwindCSS - Styling
- shadcn/ui - UI components
- React Hook Form - Form handling
- Zod - Schema validation
API Integration
The SPA communicates with WordPress via REST API endpoints:
/wp-json/woonoow/v1/shop/*- Product catalog/wp-json/woonoow/v1/cart/*- Shopping cart/wp-json/woonoow/v1/checkout/*- Checkout process/wp-json/woonoow/v1/account/*- Customer account
Deployment Modes
1. Shortcode Mode (Default)
Works with any WordPress theme via shortcodes:
[woonoow_shop][woonoow_cart][woonoow_checkout][woonoow_account]
2. Full SPA Mode
Takes over entire frontend for maximum performance.
3. Hybrid Mode
SSR for product pages (SEO), SPA for cart/checkout/account.
SEO & Tracking
- SEO-Friendly - Server-side rendering for product pages
- Analytics - Google Analytics, GTM support
- Pixels - Facebook, TikTok, Pinterest pixel support
- PixelMySite - Full compatibility
License
Proprietary - Part of WooNooW plugin