diff --git a/CUSTOMER_SETTINGS_404_FIX.md b/CUSTOMER_SETTINGS_404_FIX.md deleted file mode 100644 index ed70b33..0000000 --- a/CUSTOMER_SETTINGS_404_FIX.md +++ /dev/null @@ -1,131 +0,0 @@ -# Customer Settings 404 Error - Troubleshooting Guide - -## Issue -The `/store/customer-settings` endpoint returns 404 error. - -## Verification Steps - -### 1. Check if routes are registered -The routes ARE correctly registered in `includes/Api/StoreController.php`: -- Line 90-97: GET `/woonoow/v1/store/customer-settings` -- Line 99-106: POST `/woonoow/v1/store/customer-settings` - -### 2. Check if controller is initialized -The controller IS initialized in `includes/Api/Routes.php`: -- Line 56-57: `new StoreController()` and `register_routes()` - -### 3. Check if class exists -The `CustomerSettingsProvider` class EXISTS in: -- `includes/Compat/CustomerSettingsProvider.php` -- Namespace: `WooNooW\Compat` - -## Possible Causes & Solutions - -### Solution 1: Flush WordPress Permalinks -WordPress may need to rebuild its rewrite rules. - -**Via WP-Admin:** -1. Go to Settings โ†’ Permalinks -2. Click "Save Changes" (no need to change anything) - -**Via WP-CLI:** -```bash -wp rewrite flush -``` - -### Solution 2: Check Debug Logs -Debug logging has been added to track the issue: - -**Enable WordPress Debug:** -Add to `wp-config.php`: -```php -define('WP_DEBUG', true); -define('WP_DEBUG_LOG', true); -define('WP_DEBUG_DISPLAY', false); -``` - -**Check logs:** -```bash -tail -f wp-content/debug.log -``` - -Look for: -- `WooNooW: get_customer_settings called` -- `WooNooW: Customer settings retrieved: ...` -- `WooNooW: get_customer_settings exception: ...` - -### Solution 3: Test Endpoint Directly -Open browser console and run: -```javascript -fetch(window.WNW_CONFIG.restUrl + '/store/customer-settings', { - headers: { - 'X-WP-Nonce': window.wpApiSettings.nonce - } -}) -.then(r => r.json()) -.then(console.log) -.catch(console.error); -``` - -### Solution 4: Verify REST API is Working -Test a known endpoint: -```javascript -fetch(window.WNW_CONFIG.restUrl + '/store/branding') -.then(r => r.json()) -.then(console.log); -``` - -If this fails, the REST API itself may be broken. - -### Solution 5: Check .htaccess -Ensure `.htaccess` has WordPress rewrite rules: -```apache -# BEGIN WordPress - -RewriteEngine On -RewriteBase / -RewriteRule ^index\.php$ - [L] -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . /index.php [L] - -# END WordPress -``` - -## Expected Behavior - -**GET Request:** -```json -{ - "vip_min_spent": 1000, - "vip_min_orders": 10, - "vip_timeframe": "all", - "vip_require_both": true, - "vip_exclude_refunded": true -} -``` - -**POST Request:** -```json -{ - "success": true, - "message": "Customer settings updated successfully", - "settings": { ... } -} -``` - -## Quick Fix Checklist -- [ ] Flush permalinks -- [ ] Enable debug logging -- [ ] Check debug.log for errors -- [ ] Test endpoint in browser console -- [ ] Verify other REST endpoints work -- [ ] Check .htaccess file -- [ ] Clear all caches (browser, WordPress, server) - -## Still Not Working? -If none of the above works, there may be: -1. Plugin conflict (disable other plugins temporarily) -2. Theme conflict (switch to default theme temporarily) -3. Server configuration issue (check with hosting provider) -4. WordPress REST API disabled by security plugin diff --git a/DASHBOARD_PLAN.md b/DASHBOARD_PLAN.md deleted file mode 100644 index 22fd0af..0000000 --- a/DASHBOARD_PLAN.md +++ /dev/null @@ -1,511 +0,0 @@ -# WooNooW Dashboard Plan - -**Last updated:** 2025-10-28 -**Status:** Planning Phase -**Reference:** WooCommerce Analytics & Reports - ---- - -## ๐ŸŽฏ Overview - -The Dashboard will be the central hub for store analytics, providing at-a-glance insights and detailed reports. It follows WooCommerce's analytics structure but with a modern, performant React interface. - ---- - -## ๐Ÿ“Š Dashboard Structure - -### **Main Dashboard (`/dashboard`)** -**Purpose:** Quick overview of the most critical metrics - -#### Key Metrics (Top Row - Cards) -1. **Revenue (Today/24h)** - - Total sales amount - - Comparison with yesterday (โ†‘ +15%) - - Sparkline chart - -2. **Orders (Today/24h)** - - Total order count - - Comparison with yesterday - - Breakdown: Completed/Processing/Pending - -3. **Average Order Value** - - Calculated from today's orders - - Trend indicator - -4. **Conversion Rate** - - Orders / Visitors (if analytics available) - - Trend indicator - -#### Main Chart (Center) -- **Sales Overview Chart** (Last 7/30 days) - - Line/Area chart showing revenue over time - - Toggle: Revenue / Orders / Both - - Date range selector: 7 days / 30 days / This month / Last month / Custom - -#### Quick Stats Grid (Below Chart) -1. **Top Products (Today)** - - List of 5 best-selling products - - Product name, quantity sold, revenue - - Link to full Products report - -2. **Recent Orders** - - Last 5 orders - - Order #, Customer, Status, Total - - Link to Orders page - -3. **Low Stock Alerts** - - Products below stock threshold - - Product name, current stock, status - - Link to Products page - -4. **Top Customers** - - Top 5 customers by total spend - - Name, orders count, total spent - - Link to Customers page - ---- - -## ๐Ÿ“‘ Submenu Pages (Detailed Reports) - -### 1. **Revenue** (`/dashboard/revenue`) -**Purpose:** Detailed revenue analysis - -#### Features: -- **Date Range Selector** (Custom, presets) -- **Revenue Chart** (Daily/Weekly/Monthly granularity) -- **Breakdown Tables:** - - Revenue by Product - - Revenue by Category - - Revenue by Payment Method - - Revenue by Shipping Method -- **Comparison Mode:** Compare with previous period -- **Export:** CSV/PDF export - -#### Metrics: -- Gross Revenue -- Net Revenue (after refunds) -- Tax Collected -- Shipping Revenue -- Refunds - ---- - -### 2. **Orders** (`/dashboard/orders`) -**Purpose:** Order analytics and trends - -#### Features: -- **Orders Chart** (Timeline) -- **Status Breakdown** (Pie/Donut chart) - - Completed, Processing, Pending, Cancelled, Refunded, Failed -- **Tables:** - - Orders by Hour (peak times) - - Orders by Day of Week - - Average Processing Time -- **Filters:** Status, Date Range, Payment Method - -#### Metrics: -- Total Orders -- Average Order Value -- Orders by Status -- Fulfillment Rate -- Cancellation Rate - ---- - -### 3. **Products** (`/dashboard/products`) -**Purpose:** Product performance analysis - -#### Features: -- **Top Products Table** - - Product name, items sold, revenue, stock status - - Sortable by revenue, quantity, views -- **Category Performance** - - Revenue and sales by category - - Tree view for nested categories -- **Product Trends Chart** - - Sales trend for selected products -- **Stock Analysis** - - Low stock items - - Out of stock items - - Overstocked items (slow movers) - -#### Metrics: -- Items Sold -- Revenue per Product -- Stock Status -- Conversion Rate (if analytics available) - ---- - -### 4. **Customers** (`/dashboard/customers`) -**Purpose:** Customer behavior and segmentation - -#### Features: -- **Customer Segments** - - New Customers (first order) - - Returning Customers - - VIP Customers (high lifetime value) - - At-Risk Customers (no recent orders) -- **Top Customers Table** - - Name, total orders, total spent, last order date - - Sortable, searchable -- **Customer Acquisition Chart** - - New customers over time -- **Lifetime Value Analysis** - - Average LTV - - LTV distribution - -#### Metrics: -- Total Customers -- New Customers (period) -- Average Orders per Customer -- Customer Retention Rate -- Average Customer Lifetime Value - ---- - -### 5. **Coupons** (`/dashboard/coupons`) -**Purpose:** Coupon usage and effectiveness - -#### Features: -- **Coupon Performance Table** - - Coupon code, uses, discount amount, revenue generated - - ROI calculation -- **Usage Chart** - - Coupon usage over time -- **Top Coupons** - - Most used - - Highest revenue impact - - Best ROI - -#### Metrics: -- Total Discount Amount -- Coupons Used -- Revenue with Coupons -- Average Discount per Order - ---- - -### 6. **Taxes** (`/dashboard/taxes`) -**Purpose:** Tax collection reporting - -#### Features: -- **Tax Summary** - - Total tax collected - - By tax rate - - By location (country/state) -- **Tax Chart** - - Tax collection over time -- **Tax Breakdown Table** - - Tax rate, orders, tax amount - -#### Metrics: -- Total Tax Collected -- Tax by Rate -- Tax by Location -- Average Tax per Order - ---- - -### 7. **Downloads** (`/dashboard/downloads`) -**Purpose:** Digital product download tracking (if applicable) - -#### Features: -- **Download Stats** - - Total downloads - - Downloads by product - - Downloads by customer -- **Download Chart** - - Downloads over time -- **Top Downloaded Products** - -#### Metrics: -- Total Downloads -- Unique Downloads -- Downloads per Product -- Average Downloads per Customer - ---- - -## ๐Ÿ› ๏ธ Technical Implementation - -### Backend (PHP) - -#### New REST Endpoints: -``` -GET /woonoow/v1/analytics/overview -GET /woonoow/v1/analytics/revenue -GET /woonoow/v1/analytics/orders -GET /woonoow/v1/analytics/products -GET /woonoow/v1/analytics/customers -GET /woonoow/v1/analytics/coupons -GET /woonoow/v1/analytics/taxes -``` - -#### Query Parameters: -- `date_start` - Start date (YYYY-MM-DD) -- `date_end` - End date (YYYY-MM-DD) -- `period` - Granularity (day, week, month) -- `compare` - Compare with previous period (boolean) -- `limit` - Results limit for tables -- `orderby` - Sort field -- `order` - Sort direction (asc/desc) - -#### Data Sources: -- **HPOS Tables:** `wc_orders`, `wc_order_stats` -- **WooCommerce Analytics:** Leverage existing `wc_admin_*` tables if available -- **Custom Queries:** Optimized SQL for complex aggregations -- **Caching:** Transients for expensive queries (5-15 min TTL) - ---- - -### Frontend (React) - -#### Components: -``` -admin-spa/src/routes/Dashboard/ -โ”œโ”€โ”€ index.tsx # Main overview -โ”œโ”€โ”€ Revenue.tsx # Revenue report -โ”œโ”€โ”€ Orders.tsx # Orders analytics -โ”œโ”€โ”€ Products.tsx # Product performance -โ”œโ”€โ”€ Customers.tsx # Customer analytics -โ”œโ”€โ”€ Coupons.tsx # Coupon reports -โ”œโ”€โ”€ Taxes.tsx # Tax reports -โ””โ”€โ”€ components/ - โ”œโ”€โ”€ StatCard.tsx # Metric card with trend - โ”œโ”€โ”€ ChartCard.tsx # Chart container - โ”œโ”€โ”€ DataTable.tsx # Sortable table - โ”œโ”€โ”€ DateRangePicker.tsx # Date selector - โ”œโ”€โ”€ ComparisonToggle.tsx # Compare mode - โ””โ”€โ”€ ExportButton.tsx # CSV/PDF export -``` - -#### Charts (Recharts): -- **LineChart** - Revenue/Orders trends -- **AreaChart** - Sales overview -- **BarChart** - Comparisons, categories -- **PieChart** - Status breakdown, segments -- **ComposedChart** - Multi-metric views - -#### State Management: -- **React Query** for data fetching & caching -- **URL State** for filters (date range, sorting) -- **Local Storage** for user preferences (chart type, default period) - ---- - -## ๐ŸŽจ UI/UX Principles - -### Design: -- **Consistent with Orders module** - Same card style, spacing, typography -- **Mobile-first** - Responsive charts and tables -- **Loading States** - Skeleton loaders for charts and tables -- **Empty States** - Helpful messages when no data -- **Error Handling** - ErrorCard component for failures - -### Performance: -- **Lazy Loading** - Code-split dashboard routes -- **Optimistic Updates** - Instant feedback -- **Debounced Filters** - Reduce API calls -- **Cached Data** - React Query stale-while-revalidate - -### Accessibility: -- **Keyboard Navigation** - Full keyboard support -- **ARIA Labels** - Screen reader friendly -- **Color Contrast** - WCAG AA compliant -- **Focus Indicators** - Clear focus states - ---- - -## ๐Ÿ“… Implementation Phases - -### **Phase 1: Foundation** (Week 1) โœ… COMPLETE -- [x] Create backend analytics endpoints (Dummy data ready) -- [x] Implement data aggregation queries (Dummy data structures) -- [x] Set up caching strategy (Zustand + LocalStorage) -- [x] Create base dashboard layout -- [x] Implement StatCard component - -### **Phase 2: Main Dashboard** (Week 2) โœ… COMPLETE -- [x] Revenue/Orders/AOV/Conversion cards -- [x] Sales overview chart -- [x] Quick stats grid (Top Products, Recent Orders, etc.) -- [x] Date range selector -- [x] Dummy data toggle system -- [ ] Real-time data updates (Pending API) - -### **Phase 3: Revenue & Orders Reports** (Week 3) โœ… COMPLETE -- [x] Revenue detailed page -- [x] Orders analytics page -- [x] Breakdown tables (Product, Category, Payment, Shipping) -- [x] Status distribution charts -- [x] Period selectors -- [ ] Comparison mode (Pending) -- [ ] Export functionality (Pending) -- [ ] Advanced filters (Pending) - -### **Phase 4: Products & Customers** (Week 4) โœ… COMPLETE -- [x] Products performance page -- [x] Customer analytics page -- [x] Segmentation logic (New, Returning, VIP, At Risk) -- [x] Stock analysis (Low, Out, Slow Movers) -- [x] LTV calculations and distribution - -### **Phase 5: Coupons & Taxes** (Week 5) โœ… COMPLETE -- [x] Coupons report page -- [x] Tax reports page -- [x] ROI calculations -- [x] Location-based breakdowns - -### **Phase 6: Polish & Optimization** (Week 6) โณ IN PROGRESS -- [x] Mobile responsiveness (All pages responsive) -- [x] Loading states refinement (Skeleton loaders) -- [x] Documentation (PROGRESS_NOTE.md updated) -- [ ] Performance optimization (Pending) -- [ ] Error handling improvements (Pending) -- [ ] User testing (Pending) - -### **Phase 7: Real Data Integration** (NEW) โณ PENDING -- [ ] Create backend REST API endpoints -- [ ] Wire all pages to real data -- [ ] Keep dummy data toggle for demos -- [ ] Add data refresh functionality -- [ ] Add export functionality (CSV/PDF) -- [ ] Add comparison mode -- [ ] Add custom date range picker - ---- - -## ๐Ÿ” Data Models - -### Overview Response: -```typescript -{ - revenue: { - today: number, - yesterday: number, - change_percent: number, - sparkline: number[] - }, - orders: { - today: number, - yesterday: number, - change_percent: number, - by_status: { - completed: number, - processing: number, - pending: number, - // ... - } - }, - aov: { - current: number, - previous: number, - change_percent: number - }, - conversion_rate: { - current: number, - previous: number, - change_percent: number - }, - chart_data: Array<{ - date: string, - revenue: number, - orders: number - }>, - top_products: Array<{ - id: number, - name: string, - quantity: number, - revenue: number - }>, - recent_orders: Array<{ - id: number, - number: string, - customer: string, - status: string, - total: number, - date: string - }>, - low_stock: Array<{ - id: number, - name: string, - stock: number, - status: string - }>, - top_customers: Array<{ - id: number, - name: string, - orders: number, - total_spent: number - }> -} -``` - ---- - -## ๐Ÿ“š References - -### WooCommerce Analytics: -- WooCommerce Admin Analytics (wc-admin) -- WooCommerce Reports API -- Analytics Database Tables - -### Design Inspiration: -- Shopify Analytics -- WooCommerce native reports -- Google Analytics dashboard -- Stripe Dashboard - -### Libraries: -- **Recharts** - Charts and graphs -- **React Query** - Data fetching -- **date-fns** - Date manipulation -- **Shadcn UI** - UI components - ---- - -## ๐Ÿš€ Future Enhancements - -### Advanced Features: -- **Real-time Updates** - WebSocket for live data -- **Forecasting** - Predictive analytics -- **Custom Reports** - User-defined metrics -- **Scheduled Reports** - Email reports -- **Multi-store** - Compare multiple stores -- **API Access** - Export data via API -- **Webhooks** - Trigger on thresholds -- **Alerts** - Low stock, high refunds, etc. - -### Integrations: -- **Google Analytics** - Traffic data -- **Facebook Pixel** - Ad performance -- **Email Marketing** - Campaign ROI -- **Inventory Management** - Stock sync -- **Accounting** - QuickBooks, Xero - ---- - -## โœ… Success Metrics - -### Performance: -- Page load < 2s -- Chart render < 500ms -- API response < 1s -- 90+ Lighthouse score - -### Usability: -- Mobile-friendly (100%) -- Keyboard accessible -- Screen reader compatible -- Intuitive navigation - -### Accuracy: -- Data matches WooCommerce reports -- Real-time sync (< 5 min lag) -- Correct calculations -- No data loss - ---- - -**End of Dashboard Plan** diff --git a/DASHBOARD_TWEAKS_TODO.md b/DASHBOARD_TWEAKS_TODO.md deleted file mode 100644 index f82c74f..0000000 --- a/DASHBOARD_TWEAKS_TODO.md +++ /dev/null @@ -1,158 +0,0 @@ -# Dashboard Tweaks TODO - -## Completed โœ… - -### 1. Fix On-hold and Trash Color Conflict -**Status:** โœ… DONE - -**Issue:** Both on-hold and trash used same gray color (#6b7280) - -**Solution:** -- On-hold: `#64748b` (Slate 500) -- Trash: `#475569` (Slate 600 - darker) - -**Files Updated:** -- `includes/Api/AnalyticsController.php` (2 locations) - ---- - -## Pending Tasks - -### 2. Add "No Data" State to Charts โณ - -**Affected Charts:** -- Revenue chart (Dashboard โ†’ Revenue submenu) -- Orders chart (Dashboard โ†’ Orders submenu) -- Coupon chart (Dashboard โ†’ Coupons submenu) - -**Current Behavior:** -- Overview page shows "No data" message โœ“ -- Submenu charts show empty/broken charts โœ— - -**Required Implementation:** -```tsx -{chartData.length === 0 ? ( -
-
- -

No data available

-

- Data will appear once you have {type} -

-
-
-) : ( - - {/* Chart */} - -)} -``` - -**Files to Update:** -- `admin-spa/src/routes/Dashboard/Revenue.tsx` -- `admin-spa/src/routes/Dashboard/Orders.tsx` -- `admin-spa/src/routes/Dashboard/Coupons.tsx` - ---- - -### 3. VIP Customer Settings โณ - -**Requirement:** Add settings to configure VIP customer qualification - -**Proposed Location:** `/settings/customers` (new page) - -**Settings:** -```tsx -interface VIPSettings { - // Qualification Criteria - minTotalSpent: number; // e.g., $1000 - minOrderCount: number; // e.g., 10 orders - timeframe: 'all' | '30' | '90' | '365'; // Days or all-time - - // Optional Criteria - requireBoth: boolean; // Both spent AND count, or either? - excludeRefunded: boolean; // Exclude refunded orders? - - // Benefits (for display/reference) - vipBenefits: string[]; // e.g., ["Free shipping", "10% discount"] -} -``` - -**UI Design:** -``` -Customer Settings -โ”œโ”€โ”€ VIP Qualification -โ”‚ โ”œโ”€โ”€ Minimum Total Spent: $___ -โ”‚ โ”œโ”€โ”€ Minimum Order Count: ___ -โ”‚ โ”œโ”€โ”€ Timeframe: [All time | Last 30 days | Last 90 days | Last year] -โ”‚ โ”œโ”€โ”€ โ˜ Require both criteria (vs either one) -โ”‚ โ””โ”€โ”€ โ˜ Exclude refunded orders -โ”‚ -โ””โ”€โ”€ VIP Benefits (optional reference) - โ””โ”€โ”€ [Add benefit] button -``` - -**Implementation Steps:** -1. Create `admin-spa/src/routes/Settings/Customers.tsx` -2. Add backend endpoint: `POST /settings/customers` -3. Create `includes/Compat/CustomerSettingsProvider.php` -4. Add to navigation tree -5. Implement VIP badge logic in customer list - -**Backend Storage:** -```php -// WordPress options -woonoow_vip_min_spent = 1000 -woonoow_vip_min_orders = 10 -woonoow_vip_timeframe = 'all' -woonoow_vip_require_both = true -woonoow_vip_exclude_refunded = true -``` - -**VIP Detection Query:** -```php -function is_vip_customer($customer_id) { - $settings = get_vip_settings(); - - $query_args = [ - 'customer_id' => $customer_id, - 'status' => ['completed', 'processing'], - ]; - - if ($settings['timeframe'] !== 'all') { - $query_args['date_created'] = '>' . date('Y-m-d', strtotime("-{$settings['timeframe']} days")); - } - - if ($settings['exclude_refunded']) { - $query_args['status'] = array_diff($query_args['status'], ['refunded']); - } - - $orders = wc_get_orders($query_args); - - $total_spent = array_sum(array_map(fn($o) => $o->get_total(), $orders)); - $order_count = count($orders); - - if ($settings['require_both']) { - return $total_spent >= $settings['min_spent'] - && $order_count >= $settings['min_orders']; - } else { - return $total_spent >= $settings['min_spent'] - || $order_count >= $settings['min_orders']; - } -} -``` - ---- - -## Summary - -**Completed:** -- โœ… On-hold/Trash color conflict fixed - -**Pending:** -- โณ No data state for Revenue/Orders/Coupons charts -- โณ VIP customer settings page - -**Priority:** -1. No data states (quick fix) -2. VIP settings (new feature) diff --git a/DOCS_AUDIT_REPORT.md b/DOCS_AUDIT_REPORT.md new file mode 100644 index 0000000..9540186 --- /dev/null +++ b/DOCS_AUDIT_REPORT.md @@ -0,0 +1,125 @@ +# Documentation Audit Report + +**Date:** November 11, 2025 +**Total Documents:** 36 MD files + +--- + +## โœ… KEEP - Active & Essential (15 docs) + +### Core Architecture & Strategy +1. **NOTIFICATION_STRATEGY.md** โญ - Active implementation plan +2. **ADDON_DEVELOPMENT_GUIDE.md** - Essential for addon developers +3. **ADDON_BRIDGE_PATTERN.md** - Core addon architecture +4. **ADDON_REACT_INTEGRATION.md** - React addon integration guide +5. **HOOKS_REGISTRY.md** - Hook documentation for developers +6. **PROJECT_BRIEF.md** - Project overview and goals +7. **README.md** - Main documentation + +### Implementation Guides +8. **I18N_IMPLEMENTATION_GUIDE.md** - Translation system guide +9. **PAYMENT_GATEWAY_PATTERNS.md** - Payment gateway architecture +10. **PAYMENT_GATEWAY_FAQ.md** - Payment gateway Q&A + +### Active Development +11. **BITESHIP_ADDON_SPEC.md** - Shipping addon spec +12. **RAJAONGKIR_INTEGRATION.md** - Shipping integration +13. **SHIPPING_METHOD_TYPES.md** - Shipping types reference +14. **TAX_SETTINGS_DESIGN.md** - Tax UI/UX design +15. **SETUP_WIZARD_DESIGN.md** - Onboarding wizard design + +--- + +## ๐Ÿ—‘๏ธ DELETE - Obsolete/Completed (12 docs) + +### Completed Features +1. **CUSTOMER_SETTINGS_404_FIX.md** - Bug fixed, no longer needed +2. **MENU_FIX_SUMMARY.md** - Menu issues resolved +3. **DASHBOARD_TWEAKS_TODO.md** - Dashboard completed +4. **DASHBOARD_PLAN.md** - Dashboard implemented +5. **SPA_ADMIN_MENU_PLAN.md** - Menu implemented +6. **STANDALONE_ADMIN_SETUP.md** - Standalone mode complete +7. **STANDALONE_MODE_SUMMARY.md** - Duplicate/summary doc + +### Superseded Plans +8. **SETTINGS_PAGES_PLAN.md** - Superseded by V2 +9. **SETTINGS_PAGES_PLAN_V2.md** - Settings implemented +10. **SETTINGS_TREE_PLAN.md** - Navigation tree implemented +11. **SETTINGS_PLACEMENT_STRATEGY.md** - Strategy finalized +12. **TAX_NOTIFICATIONS_PLAN.md** - Merged into notification strategy + +--- + +## ๐Ÿ“ CONSOLIDATE - Merge & Archive (9 docs) + +### Development Process (Merge into PROJECT_SOP.md) +1. **PROGRESS_NOTE.md** - Ongoing notes +2. **TESTING_CHECKLIST.md** - Testing procedures +3. **WP_CLI_GUIDE.md** - CLI commands reference + +### Architecture Decisions (Create ARCHITECTURE.md) +4. **ARCHITECTURE_DECISION_CUSTOMER_SPA.md** - Customer SPA decision +5. **ORDER_CALCULATION_PLAN.md** - Order calculation architecture +6. **CALCULATION_EFFICIENCY_AUDIT.md** - Performance audit + +### Shipping (Create SHIPPING_GUIDE.md) +7. **SHIPPING_ADDON_RESEARCH.md** - Research notes +8. **SHIPPING_FIELD_HOOKS.md** - Field customization hooks + +### Standalone (Archive - feature complete) +9. **STANDALONE_MODE_SUMMARY.md** - Can be archived + +--- + +## ๐Ÿ“Š Summary + +| Status | Count | Action | +|--------|-------|--------| +| โœ… Keep | 15 | No action needed | +| ๐Ÿ—‘๏ธ Delete | 12 | Remove immediately | +| ๐Ÿ“ Consolidate | 9 | Merge into organized docs | +| **Total** | **36** | | + +--- + +## Recommended Actions + +### Immediate (Delete obsolete) +```bash +rm CUSTOMER_SETTINGS_404_FIX.md +rm MENU_FIX_SUMMARY.md +rm DASHBOARD_TWEAKS_TODO.md +rm DASHBOARD_PLAN.md +rm SPA_ADMIN_MENU_PLAN.md +rm STANDALONE_ADMIN_SETUP.md +rm STANDALONE_MODE_SUMMARY.md +rm SETTINGS_PAGES_PLAN.md +rm SETTINGS_PAGES_PLAN_V2.md +rm SETTINGS_TREE_PLAN.md +rm SETTINGS_PLACEMENT_STRATEGY.md +rm TAX_NOTIFICATIONS_PLAN.md +``` + +### Phase 2 (Consolidate) +1. Create `ARCHITECTURE.md` - Consolidate architecture decisions +2. Create `SHIPPING_GUIDE.md` - Consolidate shipping docs +3. Update `PROJECT_SOP.md` - Add testing & CLI guides +4. Archive `PROGRESS_NOTE.md` to `archive/` folder + +### Phase 3 (Organize) +Create folder structure: +``` +docs/ +โ”œโ”€โ”€ core/ # Core architecture & patterns +โ”œโ”€โ”€ addons/ # Addon development guides +โ”œโ”€โ”€ features/ # Feature-specific docs +โ””โ”€โ”€ archive/ # Historical/completed docs +``` + +--- + +## Post-Cleanup Result + +**Final count:** ~20 active documents +**Reduction:** 44% fewer docs +**Benefit:** Easier navigation, less confusion, clearer focus diff --git a/MENU_FIX_SUMMARY.md b/MENU_FIX_SUMMARY.md deleted file mode 100644 index 271f536..0000000 --- a/MENU_FIX_SUMMARY.md +++ /dev/null @@ -1,313 +0,0 @@ -# Settings Submenu Fix - Complete Summary - -## ๐Ÿ› Problem Identified - -**Issue:** Settings submenu only appeared in standalone mode, not in wp-admin or fullscreen mode. - -**Root Cause:** The navigation tree has **TWO sources**: -1. **Backend (PHP):** `NavigationRegistry::get_base_tree()` - Used in wp-admin and all modes -2. **Frontend (TypeScript):** `tree.ts` fallback - Only used if backend fails - -The backend was providing **empty children** for settings: -```php -// NavigationRegistry.php line 159 -'children' => [], // Settings children will be added by SettingsProvider -``` - -But `SettingsProvider` never actually populated the navigation tree! - ---- - -## โœ… Solution Implemented - -### 1. Fixed Backend Navigation Registry - -**File:** `includes/Compat/NavigationRegistry.php` - -**Changes:** -- Added `get_settings_children()` method -- Populated settings submenu in `get_base_tree()` -- Made backend the single source of truth - -**Code:** -```php -[ - 'key' => 'settings', - 'label' => __('Settings', 'woonoow'), - 'path' => '/settings', - 'icon' => 'settings', - 'children' => self::get_settings_children(), // โœ… Now populated! -], -``` - -**Settings Children:** -```php -private static function get_settings_children(): array { - $admin = admin_url('admin.php'); - - return [ - // WooNooW Settings - ['label' => __('WooNooW', 'woonoow'), 'mode' => 'spa', 'path' => '/settings'], - - // WooCommerce Settings (Most Used First) - ['label' => __('General', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/general'], - ['label' => __('Payments', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/payments'], - ['label' => __('Shipping', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/shipping'], - ['label' => __('Products', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/products'], - ['label' => __('Tax', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/tax'], - ['label' => __('Accounts & Privacy', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/accounts'], - ['label' => __('Emails', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/emails'], - - // Less Common (Bridge to WP Admin for now) - ['label' => __('Advanced', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-settings&tab=advanced'], - ['label' => __('Integration', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-settings&tab=integration'], - ['label' => __('Status', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-status'], - ['label' => __('Extensions', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-addons'], - ]; -} -``` - ---- - -### 2. Frontend Already Correct - -**File:** `admin-spa/src/nav/tree.ts` - -The frontend fallback tree was already correct (we fixed it earlier), but it wasn't being used because the backend tree takes precedence. - -**Data Flow:** -```typescript -function getNavTreeFromBackend(): MainNode[] { - const backendTree = (window as any).WNW_NAV_TREE; - - if (Array.isArray(backendTree) && backendTree.length > 0) { - return backendTree; // โœ… Backend tree used (from PHP) - } - - // Fallback to static tree (for development/safety) - return getStaticFallbackTree(); -} -``` - ---- - -## ๐ŸŽฏ Single Source of Truth Established - -### Backend (PHP) - PRIMARY SOURCE โœ… -**File:** `includes/Compat/NavigationRegistry.php` -- Builds navigation tree on `init` hook -- Stores in `wnw_nav_tree` option -- Localizes to `window.WNW_NAV_TREE` -- Used by all modes (wp-admin, fullscreen, standalone) - -### Frontend (TypeScript) - FALLBACK ONLY -**File:** `admin-spa/src/nav/tree.ts` -- Reads from `window.WNW_NAV_TREE` (backend) -- Falls back to static tree if backend unavailable -- Static tree matches backend structure - -### Flow Diagram -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ NavigationRegistry::build_nav_tree() โ”‚ -โ”‚ (PHP - runs on init hook) โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ - โ–ผ -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ Store in option: wnw_nav_tree โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ - โ–ผ -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ Localize to: window.WNW_NAV_TREE โ”‚ -โ”‚ (via Assets.php) โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ - โ–ผ -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ Frontend reads: window.WNW_NAV_TREE โ”‚ -โ”‚ (tree.ts) โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ - โ–ผ -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ useActiveSection() hook โ”‚ -โ”‚ Returns: { main, children } โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ - โ–ผ -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ SubmenuBar component โ”‚ -โ”‚ Renders: main.children โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ -``` - ---- - -## ๐Ÿงช How to Test - -### 1. Clear Navigation Cache -The navigation tree is cached in WordPress options. To rebuild: -- Deactivate and reactivate WooNooW plugin, OR -- Visit any admin page (tree rebuilds on `init` hook) - -### 2. Test in wp-admin Mode -1. Go to `/wp-admin/admin.php?page=woonoow` -2. Click "Settings" in sidebar -3. **Should see submenu:** WooNooW, General, Payments, Shipping, Products, Tax, Accounts & Privacy, Emails, Advanced, Integration, Status, Extensions - -### 3. Test in Fullscreen Mode -1. Click fullscreen toggle -2. Click "Settings" in sidebar -3. **Should see same submenu** - -### 4. Test in Standalone Mode -1. Go to `/admin` -2. Click "Settings" in sidebar -3. **Should see same submenu** - -### 5. Verify Backend Data -Open browser console and check: -```javascript -console.log(window.WNW_NAV_TREE); -// Should show array with settings.children populated -``` - ---- - -## ๐Ÿ“Š Before vs After - -### Before โŒ -``` -wp-admin mode: -Settings -โ””โ”€โ”€ (no submenu) - -fullscreen mode: -Settings -โ””โ”€โ”€ (no submenu) - -standalone mode: -Settings -โ”œโ”€โ”€ WooNooW -โ”œโ”€โ”€ General -โ”œโ”€โ”€ Payments -โ””โ”€โ”€ ... (all items) -``` - -### After โœ… -``` -ALL MODES: -Settings -โ”œโ”€โ”€ WooNooW -โ”œโ”€โ”€ General -โ”œโ”€โ”€ Payments -โ”œโ”€โ”€ Shipping -โ”œโ”€โ”€ Products -โ”œโ”€โ”€ Tax -โ”œโ”€โ”€ Accounts & Privacy -โ”œโ”€โ”€ Emails -โ”œโ”€โ”€ Advanced (bridge) -โ”œโ”€โ”€ Integration (bridge) -โ”œโ”€โ”€ Status (bridge) -โ””โ”€โ”€ Extensions (bridge) -``` - ---- - -## ๐Ÿ”ง Files Modified - -### Backend -- โœ… `includes/Compat/NavigationRegistry.php` - - Added `get_settings_children()` method - - Updated `get_base_tree()` to use it - -### Frontend -- โœ… `admin-spa/src/nav/tree.ts` (already correct from previous fix) -- โœ… `admin-spa/src/types/window.d.ts` (TypeScript types) - -### Documentation -- โœ… `SETTINGS_TREE_PLAN.md` (new - comprehensive implementation plan) -- โœ… `MENU_FIX_SUMMARY.md` (this document) - ---- - -## ๐ŸŽฏ Key Learnings - -### 1. Dynamic Navigation System -WooNooW uses a **dynamic navigation system** where: -- Backend (PHP) builds the tree -- Frontend (TypeScript) consumes it -- Addons can extend via filters - -### 2. Cache Awareness -Navigation tree is cached in `wnw_nav_tree` option: -- Rebuilt on `init` hook -- Flushed on plugin activate/deactivate -- Can be manually flushed: `delete_option('wnw_nav_tree')` - -### 3. Extensibility -Addons can modify navigation via filters: -```php -// Add new main section -add_filter('woonoow/nav_tree', function($tree) { - $tree[] = [ - 'key' => 'subscriptions', - 'label' => 'Subscriptions', - 'path' => '/subscriptions', - 'icon' => 'repeat', - 'children' => [...] - ]; - return $tree; -}); - -// Add to existing section -add_filter('woonoow/nav_tree/settings/children', function($children) { - $children[] = [ - 'label' => 'My Custom Setting', - 'mode' => 'spa', - 'path' => '/settings/custom' - ]; - return $children; -}); -``` - ---- - -## โœ… Verification Checklist - -- [x] Backend provides settings children -- [x] Frontend reads from backend -- [x] Fallback tree matches backend -- [x] TypeScript types updated -- [x] No console errors -- [x] Settings submenu shows in all modes -- [x] Bridge links work -- [x] Documentation updated -- [x] Code committed - ---- - -## ๐Ÿš€ Next Steps - -1. **Test the fix:** - - Reload wp-admin page - - Check settings submenu appears - - Test in all three modes - -2. **Implement settings pages:** - - Start with Phase 1 (General, Payments, Shipping) - - Follow `SETTINGS_TREE_PLAN.md` - -3. **Monitor for issues:** - - Check browser console - - Test with different user roles - - Verify 3rd party plugin compatibility - ---- - -**Fix Date:** November 5, 2025 -**Status:** โœ… Complete -**Tested:** Pending user verification -**Next:** Implement General Settings page diff --git a/SETTINGS_PAGES_PLAN.md b/SETTINGS_PAGES_PLAN.md deleted file mode 100644 index 0cd6189..0000000 --- a/SETTINGS_PAGES_PLAN.md +++ /dev/null @@ -1,578 +0,0 @@ -# Settings Pages Implementation Plan - -## Overview - -Build 4 missing settings pages to complete WooNooW Settings: -1. **WooNooW** - Main settings/preferences -2. **Checkout** - Checkout page configuration -3. **Customer Accounts** - Account creation and management -4. **Brand & Appearance** - Store branding and customization - ---- - -## 1. WooNooW Settings Page - -**File:** `admin-spa/src/routes/Settings/index.tsx` - -**Purpose:** Main WooNooW plugin settings and preferences - -### Sections: - -#### A. General Settings -```tsx -- Plugin Version: 1.0.0 (read-only) -- Enable SPA Mode: [Toggle] (default: ON) -- Admin Theme: [Select: Light | Dark | Auto] -- Items per page: [Number: 20] -``` - -#### B. Performance -```tsx -- Enable caching: [Toggle] (default: ON) -- Cache duration: [Number: 3600] seconds -- Preload data: [Toggle] (default: ON) -``` - -#### C. Features -```tsx -- Enable quick edit: [Toggle] (default: ON) -- Enable bulk actions: [Toggle] (default: ON) -- Enable keyboard shortcuts: [Toggle] (default: ON) -- Enable auto-save: [Toggle] (default: ON) -``` - -#### D. Developer -```tsx -- Debug mode: [Toggle] (default: OFF) -- Show API logs: [Toggle] (default: OFF) -- Enable React DevTools: [Toggle] (default: OFF) -``` - -### API Endpoints: - -```php -// GET /woonoow/v1/settings -// POST /woonoow/v1/settings - -// Options stored: -- woonoow_enable_spa -- woonoow_admin_theme -- woonoow_items_per_page -- woonoow_enable_caching -- woonoow_cache_duration -- woonoow_enable_quick_edit -- woonoow_enable_bulk_actions -- woonoow_enable_shortcuts -- woonoow_enable_autosave -- woonoow_debug_mode -``` - -### Implementation: - -```tsx -// admin-spa/src/routes/Settings/index.tsx - -import { SettingsLayout } from './components/SettingsLayout'; -import { SettingsSection } from './components/SettingsSection'; -import { ToggleField } from './components/ToggleField'; - -export default function WooNooWSettings() { - const [settings, setSettings] = useState({ - enable_spa: true, - admin_theme: 'auto', - items_per_page: 20, - enable_caching: true, - // ... - }); - - return ( - - - setSettings({ ...settings, enable_spa: checked })} - /> - - setSettings({ ...settings, admin_theme: value })} - /> - - - - {/* ... */} - - - - {/* ... */} - - - ); -} -``` - ---- - -## 2. Checkout Settings Page - -**File:** `admin-spa/src/routes/Settings/Checkout.tsx` - -**Purpose:** Configure checkout page behavior and options - -### Sections: - -#### A. Checkout Options -```tsx -- Enable guest checkout: [Toggle] -- Require account creation: [Toggle] -- Allow customers to create account during checkout: [Toggle] -- Allow customers to login during checkout: [Toggle] -``` - -#### B. Checkout Fields -```tsx -- Company name: [Select: Required | Optional | Hidden] -- Address line 2: [Select: Required | Optional | Hidden] -- Phone: [Select: Required | Optional | Hidden] -- Order notes: [Toggle] Enable order notes -``` - -#### C. Terms & Conditions -```tsx -- Enable terms and conditions: [Toggle] -- Terms page: [Page Select] -- Privacy policy page: [Page Select] -``` - -#### D. Order Processing -```tsx -- Default order status: [Select: Pending | Processing | On Hold] -- Auto-complete virtual orders: [Toggle] -- Auto-complete downloadable orders: [Toggle] -``` - -### API Endpoints: - -```php -// GET /woonoow/v1/settings/checkout -// POST /woonoow/v1/settings/checkout - -// WooCommerce options: -- woocommerce_enable_guest_checkout -- woocommerce_enable_signup_and_login_from_checkout -- woocommerce_enable_checkout_login_reminder -- woocommerce_checkout_company_field -- woocommerce_checkout_address_2_field -- woocommerce_checkout_phone_field -- woocommerce_enable_order_notes_field -- woocommerce_terms_page_id -- woocommerce_privacy_policy_page_id -``` - -### Implementation: - -```tsx -// admin-spa/src/routes/Settings/Checkout.tsx - -export default function CheckoutSettings() { - const { data: settings, isLoading } = useQuery({ - queryKey: ['settings', 'checkout'], - queryFn: () => api.get('/settings/checkout'), - }); - - const mutation = useMutation({ - mutationFn: (data) => api.post('/settings/checkout', data), - onSuccess: () => { - toast.success('Checkout settings saved'); - }, - }); - - return ( - - - { - mutation.mutate({ ...settings, enable_guest_checkout: checked }); - }} - /> - {/* ... */} - - - - - {/* ... */} - - - ); -} -``` - ---- - -## 3. Customer Accounts Settings Page - -**File:** `admin-spa/src/routes/Settings/Customers.tsx` - -**Purpose:** Configure customer account creation and management - -### Sections: - -#### A. Account Creation -```tsx -- Allow customers to create account on "My Account" page: [Toggle] -- Allow customers to create account during checkout: [Toggle] -- Automatically generate username from email: [Toggle] -- Automatically generate password: [Toggle] -``` - -#### B. Account Security -```tsx -- Require strong passwords: [Toggle] -- Minimum password length: [Number: 8] -- Enable two-factor authentication: [Toggle] -``` - -#### C. Privacy -```tsx -- Privacy policy page: [Page Select] -- Remove personal data on request: [Toggle] -- Allow personal data export: [Toggle] -- Personal data retention: [Number: 365] days -``` - -#### D. Account Dashboard -```tsx -- Enable account dashboard: [Toggle] -- Show recent orders: [Toggle] -- Show downloads: [Toggle] -- Show addresses: [Toggle] -- Show account details: [Toggle] -``` - -### API Endpoints: - -```php -// GET /woonoow/v1/settings/customers -// POST /woonoow/v1/settings/customers - -// WooCommerce options: -- woocommerce_enable_myaccount_registration -- woocommerce_enable_signup_and_login_from_checkout -- woocommerce_registration_generate_username -- woocommerce_registration_generate_password -- woocommerce_privacy_policy_page_id -``` - -### Implementation: - -```tsx -// admin-spa/src/routes/Settings/Customers.tsx - -export default function CustomerAccountsSettings() { - return ( - - - - - - - - - - - - - - - - - - - - - - ); -} -``` - ---- - -## 4. Brand & Appearance Settings Page - -**File:** `admin-spa/src/routes/Settings/Brand.tsx` - -**Purpose:** Customize store branding and visual appearance - -### Sections: - -#### A. Store Identity -```tsx -- Store logo: [Image Upload] -- Store icon/favicon: [Image Upload] -- Store tagline: [Text Input] -``` - -#### B. Brand Colors -```tsx -- Primary color: [Color Picker: #3b82f6] -- Secondary color: [Color Picker: #8b5cf6] -- Accent color: [Color Picker: #10b981] -- Success color: [Color Picker: #22c55e] -- Warning color: [Color Picker: #f59e0b] -- Error color: [Color Picker: #ef4444] -``` - -#### C. Typography -```tsx -- Heading font: [Font Select: Inter, Roboto, etc.] -- Body font: [Font Select: Inter, Roboto, etc.] -- Font size: [Select: Small | Medium | Large] -``` - -#### D. Admin UI -```tsx -- Sidebar position: [Select: Left | Right] -- Sidebar collapsed by default: [Toggle] -- Show breadcrumbs: [Toggle] -- Compact mode: [Toggle] -``` - -#### E. Custom CSS -```tsx -- Custom CSS: [Code Editor] -``` - -### API Endpoints: - -```php -// GET /woonoow/v1/settings/brand -// POST /woonoow/v1/settings/brand - -// Custom options: -- woonoow_store_logo -- woonoow_store_icon -- woonoow_store_tagline -- woonoow_primary_color -- woonoow_secondary_color -- woonoow_accent_color -- woonoow_heading_font -- woonoow_body_font -- woonoow_font_size -- woonoow_sidebar_position -- woonoow_sidebar_collapsed -- woonoow_custom_css -``` - -### Implementation: - -```tsx -// admin-spa/src/routes/Settings/Brand.tsx - -export default function BrandAppearanceSettings() { - return ( - - - updateSetting('store_logo', url)} - /> - - updateSetting('store_icon', url)} - /> - - updateSetting('store_tagline', value)} - /> - - - -
- updateSetting('primary_color', color)} - /> - - updateSetting('secondary_color', color)} - /> - - updateSetting('accent_color', color)} - /> -
-
- - - - - - - updateSetting('custom_css', code)} - /> - -
- ); -} -``` - ---- - -## Implementation Steps - -### Phase 1: Create Components (Week 1) -1. Create `ColorPickerField.tsx` -2. Create `ImageUploadField.tsx` -3. Create `CodeEditorField.tsx` -4. Create `PageSelectField.tsx` -5. Create `NumberField.tsx` - -### Phase 2: Backend API (Week 1) -1. Create `SettingsController.php` -2. Add endpoints for each settings page -3. Add validation and sanitization -4. Test API endpoints - -### Phase 3: Frontend Pages (Week 2) -1. Build WooNooW settings page -2. Build Checkout settings page -3. Build Customer Accounts settings page -4. Build Brand & Appearance settings page - -### Phase 4: Integration (Week 2) -1. Connect frontend to API -2. Add loading states -3. Add error handling -4. Add success notifications -5. Test all settings - -### Phase 5: Polish (Week 3) -1. Add help text and tooltips -2. Add preview for brand colors -3. Add validation messages -4. Add keyboard shortcuts -5. Final testing - ---- - -## File Structure - -``` -admin-spa/src/routes/Settings/ -โ”œโ”€โ”€ index.tsx (WooNooW Settings) โœ… Update -โ”œโ”€โ”€ Checkout.tsx (NEW) -โ”œโ”€โ”€ Customers.tsx (NEW) -โ”œโ”€โ”€ Brand.tsx (NEW) -โ”œโ”€โ”€ Store.tsx (Existing โœ…) -โ”œโ”€โ”€ Payments.tsx (Existing โœ…) -โ”œโ”€โ”€ Shipping.tsx (Existing โœ…) -โ”œโ”€โ”€ Tax.tsx (Existing โœ…) -โ”œโ”€โ”€ Notifications.tsx (Existing โœ…) -โ””โ”€โ”€ components/ - โ”œโ”€โ”€ SettingsLayout.tsx (Existing โœ…) - โ”œโ”€โ”€ SettingsSection.tsx (Existing โœ…) - โ”œโ”€โ”€ SettingsCard.tsx (Existing โœ…) - โ”œโ”€โ”€ ToggleField.tsx (Existing โœ…) - โ”œโ”€โ”€ ColorPickerField.tsx (NEW) - โ”œโ”€โ”€ ImageUploadField.tsx (NEW) - โ”œโ”€โ”€ CodeEditorField.tsx (NEW) - โ”œโ”€โ”€ PageSelectField.tsx (NEW) - โ””โ”€โ”€ NumberField.tsx (NEW) -``` - -``` -includes/Api/ -โ”œโ”€โ”€ SettingsController.php (NEW) -โ””โ”€โ”€ OrdersController.php (Existing โœ…) -``` - ---- - -## Priority - -1. **High Priority:** WooNooW Settings, Checkout Settings -2. **Medium Priority:** Customer Accounts Settings -3. **Low Priority:** Brand & Appearance Settings - ---- - -## Estimated Timeline - -- **Week 1:** Components + Backend API -- **Week 2:** Frontend Pages + Integration -- **Week 3:** Polish + Testing - -**Total: 3 weeks** diff --git a/SETTINGS_PAGES_PLAN_V2.md b/SETTINGS_PAGES_PLAN_V2.md deleted file mode 100644 index d027bd0..0000000 --- a/SETTINGS_PAGES_PLAN_V2.md +++ /dev/null @@ -1,481 +0,0 @@ -# Settings Pages Implementation Plan V2 - -## Overview - Refined Approach - -**Final Settings Structure (5 tabs only):** -1. **Store Details** - Store identity, branding, contact info (merge Brand & Appearance here) -2. **Payments** - Payment gateway management โœ… Already built -3. **Shipping & Delivery** - Shipping zones and methods โœ… Already built -4. **Tax** - Tax rates and settings โœ… Already built -5. **Notifications** - Email templates and notifications โœ… Already built -6. **Developer** - Debug mode, API logs, React DevTools (NEW - only for maintenance) - -**Eliminated:** -- โŒ WooNooW Settings (nonsense toggles) -- โŒ Checkout Settings (mirror WooCommerce, not essential) -- โŒ Customer Accounts (mirror WooCommerce, not essential) -- โŒ Brand & Appearance (merge into Store Details) - ---- - -## Philosophy - -### โœ… What We Build: -- **Essential settings accessed frequently** -- **Simplified UI for complex WooCommerce features** -- **Industry best practices (Shopify, marketplaces)** -- **Critical features that enhance WooCommerce** - -### โŒ What We Don't Build: -- Mirroring WooCommerce as-is -- Nonsense toggles for essential features -- Settings for non-tech users to break things -- Redundant configuration options - -### ๐ŸŽฏ Principle: -> "We do the best config. Users focus on their business, not system configuration." - ---- - -## 1. Store Details (Enhanced) - -**File:** `admin-spa/src/routes/Settings/Store.tsx` (UPDATE existing) - -**Purpose:** Complete store identity and branding in one place - -### Current Structure (Keep): -- โœ… Store name -- โœ… Contact email -- โœ… Customer support email -- โœ… Store phone -- โœ… Store address - -### Add to Existing: - -#### Store Identity Section (NEW) -```tsx - - updateSetting('store_logo', url)} - /> - - updateSetting('store_icon', url)} - /> - - updateSetting('store_tagline', value)} - /> - -``` - -#### Brand Colors Section (NEW) -```tsx - -
- updateSetting('primary_color', color)} - /> - - updateSetting('accent_color', color)} - /> - - updateSetting('error_color', color)} - /> -
- -
- - - -
-
-``` - -### Implementation Notes: - -**Theme Toggle:** -- Add to topbar (not settings page) -- Store in localStorage: `woonoow_theme` -- Options: `light`, `dark`, `auto` -- Apply via CSS class on `` - -**Color System:** -- Store in options: `woonoow_primary_color`, etc. -- Inject CSS variables in admin head -- Live preview (no page reload) - -**API Endpoints:** -```php -// GET /woonoow/v1/settings/store -// POST /woonoow/v1/settings/store - -// New options: -- woonoow_store_logo -- woonoow_store_icon -- woonoow_store_tagline -- woonoow_primary_color -- woonoow_accent_color -- woonoow_error_color -``` - ---- - -## 2. Developer Settings (NEW) - -**File:** `admin-spa/src/routes/Settings/Developer.tsx` - -**Purpose:** Maintenance and debugging tools for developers only - -### Sections: - -#### Debug Mode -```tsx - - updateSetting('debug_mode', checked)} - /> - - {settings.debug_mode && ( - <> - updateSetting('show_api_logs', checked)} - /> - - updateSetting('enable_react_devtools', checked)} - /> - - )} - -``` - -#### System Information (Read-only) -```tsx - -
-
- WooNooW Version: - {systemInfo.woonoow_version} -
-
- WooCommerce Version: - {systemInfo.woocommerce_version} -
-
- WordPress Version: - {systemInfo.wordpress_version} -
-
- PHP Version: - {systemInfo.php_version} -
-
- HPOS Enabled: - {systemInfo.hpos_enabled ? 'Yes' : 'No'} -
-
-
-``` - -#### Cache Management -```tsx - -
- - - - - -
-
-``` - -### API Endpoints: -```php -// GET /woonoow/v1/settings/developer -// POST /woonoow/v1/settings/developer -// POST /woonoow/v1/cache/clear - -// Options: -- woonoow_debug_mode -- woonoow_show_api_logs -- woonoow_enable_react_devtools -``` - ---- - -## 3. What About Checkout & Customer Accounts? - -### Industry Best Practices Analysis: - -#### Shopify Checkout Settings: -**Essential Only:** -- Customer contact method (email/phone) -- Customer information (require first/last name) -- Shipping address (require company name: optional/required/hidden) -- Marketing opt-in -- Abandoned checkout recovery - -**NOT in settings:** -- Guest checkout (always enabled) -- Account creation (automatic) -- Order notes (always available) - -#### Marketplace Best Practices: -**Focus on:** -- Payment flow optimization -- Shipping calculation accuracy -- Tax compliance -- Order fulfillment speed - -**NOT configurable:** -- Basic checkout fields (always there) -- Account creation flow (standardized) -- Login/registration (automatic) - -### Our Approach: - -**โœ… We do the best config:** -- Enable guest checkout (always) -- Allow account creation during checkout (always) -- Generate username from email (always) -- All essential fields enabled (always) -- Order notes available (always) - -**โŒ We don't build settings for:** -- Toggling essential features -- Breaking standard checkout flow -- Confusing non-tech users -- Mirroring WooCommerce as-is - -**If users need advanced customization:** -- Use WooCommerce native settings -- Use hooks and filters -- Use custom code -- We focus on 80% use case - ---- - -## Final Settings Structure - -``` -Settings -โ”œโ”€โ”€ Store Details (Enhanced) -โ”‚ โ”œโ”€โ”€ Store Information -โ”‚ โ”œโ”€โ”€ Contact Details -โ”‚ โ”œโ”€โ”€ Store Address -โ”‚ โ”œโ”€โ”€ Store Identity (NEW) -โ”‚ โ”‚ โ”œโ”€โ”€ Logo -โ”‚ โ”‚ โ”œโ”€โ”€ Icon -โ”‚ โ”‚ โ””โ”€โ”€ Tagline -โ”‚ โ””โ”€โ”€ Brand Colors (NEW) -โ”‚ โ”œโ”€โ”€ Primary -โ”‚ โ”œโ”€โ”€ Accent -โ”‚ โ”œโ”€โ”€ Error -โ”‚ โ””โ”€โ”€ Theme Toggle -โ”‚ -โ”œโ”€โ”€ Payments (Existing โœ…) -โ”‚ โ””โ”€โ”€ Payment gateway management -โ”‚ -โ”œโ”€โ”€ Shipping & Delivery (Existing โœ…) -โ”‚ โ””โ”€โ”€ Shipping zones and methods -โ”‚ -โ”œโ”€โ”€ Tax (Existing โœ…) -โ”‚ โ””โ”€โ”€ Tax rates and settings -โ”‚ -โ”œโ”€โ”€ Notifications (Existing โœ…) -โ”‚ โ””โ”€โ”€ Email templates -โ”‚ -โ””โ”€โ”€ Developer (NEW) - โ”œโ”€โ”€ Debug Mode - โ”œโ”€โ”€ System Information - โ””โ”€โ”€ Cache Management -``` - -**Total: 6 tabs (down from 13!)** - ---- - -## Implementation Priority - -### Phase 1: Store Details Enhancement (Week 1) -1. Add Store Identity section -2. Add Brand Colors section -3. Implement color system with CSS variables -4. Add theme toggle to topbar -5. Test and polish - -### Phase 2: Developer Settings (Week 1) -1. Create Developer settings page -2. Add debug mode toggles -3. Add system information display -4. Add cache management -5. Test and polish - -### Phase 3: Polish (Week 2) -1. Add help text and tooltips -2. Add color preview -3. Add validation -4. Final testing -5. Documentation - -**Total: 2 weeks** - ---- - -## Components Needed - -### New Components: -1. `ColorPickerField.tsx` - Color picker with preview -2. `ImageUploadField.tsx` - Image upload with preview - -### Existing Components (Reuse): -- โœ… `SettingsLayout.tsx` -- โœ… `SettingsSection.tsx` -- โœ… `SettingsCard.tsx` -- โœ… `ToggleField.tsx` -- โœ… `TextField.tsx` -- โœ… `Button.tsx` - ---- - -## Key Decisions - -### โœ… What We Decided: - -1. **Merge Brand & Appearance into Store Details** - - More logical grouping - - Fewer tabs - - Better UX - -2. **No Checkout/Customer Accounts Settings** - - We do the best config - - No need to expose WooCommerce complexity - - Focus on business, not system config - -3. **Developer Settings Separate** - - Only for maintenance - - Not for regular users - - Clear separation of concerns - -4. **Theme Toggle in Topbar** - - Quick access - - Not buried in settings - - Industry standard (GitHub, VS Code) - -5. **Essential Colors Only** - - Primary, Accent, Error - - No overwhelming options - - Easy to customize - -### โŒ What We Rejected: - -1. **Nonsense Toggles** - - Enable SPA Mode (plugin activation = enabled) - - Enable Quick Edit (essential feature) - - Enable Bulk Actions (essential feature) - - Enable Keyboard Shortcuts (essential feature) - -2. **Performance Settings** - - Enable caching (we do best config) - - Cache duration (we optimize) - - Preload data (we handle) - -3. **Typography Settings** - - Font selection (breaks design) - - Font size (use browser zoom) - -4. **Admin UI Settings** - - Sidebar position (we optimize) - - Sidebar collapsed (we handle) - - Compact mode (we optimize) - -5. **Custom CSS** - - Hard to use (no selectors) - - Better in theme - - Only for developers (if needed, add to Developer page) - ---- - -## Summary - -**From 13 tabs to 6 tabs:** -- โœ… Store Details (enhanced with branding) -- โœ… Payments (existing) -- โœ… Shipping & Delivery (existing) -- โœ… Tax (existing) -- โœ… Notifications (existing) -- โœ… Developer (new, for maintenance) - -**Philosophy:** -> "We do the best config. Users focus on their business, not system configuration." - -**Result:** -- Clean, focused settings -- Industry best practices -- No bloat -- Easy to use -- Professional diff --git a/SETTINGS_PLACEMENT_STRATEGY.md b/SETTINGS_PLACEMENT_STRATEGY.md deleted file mode 100644 index d89b993..0000000 --- a/SETTINGS_PLACEMENT_STRATEGY.md +++ /dev/null @@ -1,380 +0,0 @@ -# WooNooW Settings Placement Strategy - -## Philosophy - -**No separate "WooNooW Settings" page needed.** - -Instead, integrate WooNooW settings seamlessly into existing WooCommerce/WordPress settings pages by context. - ---- - -## Current WooCommerce Settings Structure - -``` -WooCommerce > Settings -โ”œโ”€โ”€ General -โ”‚ โ”œโ”€โ”€ Store Address -โ”‚ โ”œโ”€โ”€ Selling Location -โ”‚ โ”œโ”€โ”€ Currency -โ”‚ โ””โ”€โ”€ ... -โ”œโ”€โ”€ Products -โ”‚ โ”œโ”€โ”€ General -โ”‚ โ”œโ”€โ”€ Inventory -โ”‚ โ””โ”€โ”€ ... -โ”œโ”€โ”€ Tax -โ”‚ โ”œโ”€โ”€ Tax Options -โ”‚ โ””โ”€โ”€ Standard Rates -โ”œโ”€โ”€ Shipping -โ”‚ โ”œโ”€โ”€ Shipping Zones -โ”‚ โ””โ”€โ”€ Shipping Options -โ””โ”€โ”€ ... -``` - ---- - -## WooNooW Settings Integration - -### 1. Store Identity Settings - -**Location:** `WooCommerce > Settings > General` (or new "Store Details" tab) - -**WooNooW Fields:** -- โœ… Store Logo (upload) -- โœ… Store Icon/Favicon -- โœ… Brand Colors (primary, secondary) -- โœ… Store Tagline - -**Why here?** -- Related to store identity -- Used across admin and frontend -- Makes sense with existing "Store Address" fields - -**Implementation:** -```php -add_filter('woocommerce_general_settings', function($settings) { - $woonoow_settings = [ - [ - 'title' => __('Store Identity', 'woonoow'), - 'type' => 'title', - 'desc' => __('Customize your store branding', 'woonoow'), - 'id' => 'woonoow_store_identity', - ], - [ - 'title' => __('Store Logo', 'woonoow'), - 'type' => 'text', - 'desc' => __('Upload your store logo', 'woonoow'), - 'id' => 'woonoow_store_logo', - 'custom_attributes' => ['data-upload' => 'image'], - ], - [ - 'title' => __('Primary Color', 'woonoow'), - 'type' => 'color', - 'id' => 'woonoow_primary_color', - 'default' => '#3b82f6', - ], - [ - 'type' => 'sectionend', - 'id' => 'woonoow_store_identity', - ], - ]; - - return array_merge($settings, $woonoow_settings); -}); -``` - ---- - -### 2. Order Settings - -**Location:** `WooCommerce > Settings > General` or new "Orders" tab - -**WooNooW Fields:** -- โœ… Default order status -- โœ… Order number format -- โœ… Enable order notes -- โœ… Auto-complete virtual orders - -**Why here?** -- Order-specific settings -- Used in OrderForm and order processing -- Contextually related - ---- - -### 3. Product Settings - -**Location:** `WooCommerce > Settings > Products` - -**WooNooW Fields:** -- โœ… Enable quick edit -- โœ… Default product type -- โœ… Enable bulk actions -- โœ… Product image sizes - -**Why here?** -- Product-specific settings -- Used in ProductForm -- Already in Products context - ---- - -### 4. UI/UX Settings - -**Location:** New tab `WooCommerce > Settings > Admin UI` or `WooNooW` - -**WooNooW Fields:** -- โœ… Enable/disable SPA mode -- โœ… Theme (light/dark/auto) -- โœ… Sidebar collapsed by default -- โœ… Items per page -- โœ… Date format preference - -**Why separate tab?** -- WooNooW-specific features -- Not related to store operations -- Admin experience customization - -**Implementation:** -```php -add_filter('woocommerce_settings_tabs_array', function($tabs) { - $tabs['woonoow'] = __('Admin UI', 'woonoow'); - return $tabs; -}, 50); - -add_action('woocommerce_settings_woonoow', function() { - woocommerce_admin_fields([ - [ - 'title' => __('WooNooW Admin Settings', 'woonoow'), - 'type' => 'title', - 'desc' => __('Customize your admin experience', 'woonoow'), - ], - [ - 'title' => __('Enable SPA Mode', 'woonoow'), - 'type' => 'checkbox', - 'desc' => __('Use single-page application for faster navigation', 'woonoow'), - 'id' => 'woonoow_enable_spa', - 'default' => 'yes', - ], - [ - 'title' => __('Theme', 'woonoow'), - 'type' => 'select', - 'options' => [ - 'light' => __('Light', 'woonoow'), - 'dark' => __('Dark', 'woonoow'), - 'auto' => __('Auto (System)', 'woonoow'), - ], - 'id' => 'woonoow_theme', - 'default' => 'auto', - ], - ]); -}); -``` - ---- - -## Settings Organization - -### By Context (Recommended): - -``` -WooCommerce > Settings > General - โ””โ”€โ”€ Store Identity (WooNooW) - โ”œโ”€โ”€ Store Logo - โ”œโ”€โ”€ Brand Colors - โ””โ”€โ”€ ... - -WooCommerce > Settings > Products - โ””โ”€โ”€ Product Management (WooNooW) - โ”œโ”€โ”€ Quick Edit - โ”œโ”€โ”€ Bulk Actions - โ””โ”€โ”€ ... - -WooCommerce > Settings > Orders - โ””โ”€โ”€ Order Processing (WooNooW) - โ”œโ”€โ”€ Order Number Format - โ”œโ”€โ”€ Default Status - โ””โ”€โ”€ ... - -WooCommerce > Settings > Admin UI (New Tab) - โ””โ”€โ”€ WooNooW Settings - โ”œโ”€โ”€ SPA Mode - โ”œโ”€โ”€ Theme - โ”œโ”€โ”€ UI Preferences - โ””โ”€โ”€ ... -``` - -### Benefits: - -โœ… **Contextual** - Settings appear where they're relevant -โœ… **Familiar** - Uses existing WooCommerce settings structure -โœ… **No clutter** - No separate "WooNooW Settings" menu -โœ… **Intuitive** - Users find settings where they expect them -โœ… **Seamless** - Feels like native WooCommerce - ---- - -## Implementation Strategy - -### Phase 1: Integrate into Existing Tabs - -```php -// Store Identity โ†’ General tab -add_filter('woocommerce_general_settings', 'woonoow_add_store_identity_settings'); - -// Product Settings โ†’ Products tab -add_filter('woocommerce_product_settings', 'woonoow_add_product_settings'); - -// Order Settings โ†’ General tab or new Orders tab -add_filter('woocommerce_general_settings', 'woonoow_add_order_settings'); -``` - -### Phase 2: Add WooNooW-Specific Tab (If Needed) - -```php -// Only for settings that don't fit elsewhere -add_filter('woocommerce_settings_tabs_array', function($tabs) { - $tabs['woonoow'] = __('Admin UI', 'woonoow'); - return $tabs; -}); -``` - -### Phase 3: Settings API - -Provide a clean API for addons to register settings: - -```php -// Addon can add settings to any tab -WooNooW_Settings::add_field('general', [ - 'id' => 'my_addon_setting', - 'title' => 'My Setting', - 'type' => 'text', -]); - -// Or create own section -WooNooW_Settings::add_section('general', [ - 'id' => 'my_addon_section', - 'title' => 'My Addon Settings', - 'fields' => [...], -]); -``` - ---- - -## Examples - -### Example 1: Store Logo - -**Bad (Separate Page):** -``` -WooNooW > Settings > Store Logo -``` - -**Good (Contextual):** -``` -WooCommerce > Settings > General > Store Identity > Store Logo -``` - -### Example 2: Order Number Format - -**Bad (Separate Page):** -``` -WooNooW > Settings > Order Number Format -``` - -**Good (Contextual):** -``` -WooCommerce > Settings > Orders > Order Number Format -``` - -### Example 3: SPA Mode - -**Acceptable (WooNooW-Specific):** -``` -WooCommerce > Settings > Admin UI > Enable SPA Mode -``` - ---- - -## Settings Categories - -### Store Settings (Contextual Integration) -- Store Logo โ†’ `General` -- Brand Colors โ†’ `General` -- Currency Display โ†’ `General` -- Tax Display โ†’ `Tax` -- Shipping Display โ†’ `Shipping` - -### Product Settings (Contextual Integration) -- Default Product Type โ†’ `Products > General` -- Quick Edit โ†’ `Products > General` -- Inventory Settings โ†’ `Products > Inventory` - -### Order Settings (Contextual Integration) -- Order Number Format โ†’ `Orders` (new tab) or `General` -- Default Status โ†’ `Orders` -- Auto-complete โ†’ `Orders` - -### Admin UI Settings (New Tab) -- SPA Mode โ†’ `Admin UI` -- Theme โ†’ `Admin UI` -- Sidebar โ†’ `Admin UI` -- Items per Page โ†’ `Admin UI` - ---- - -## Migration from Current Settings - -If WooNooW currently has a separate settings page: - -### Step 1: Identify Settings -``` -Current: WooNooW > Settings > All Settings -``` - -### Step 2: Categorize -``` -Store Logo โ†’ Move to General -Order Format โ†’ Move to Orders -SPA Mode โ†’ Move to Admin UI -``` - -### Step 3: Migrate -```php -// Remove old settings page -remove_menu_page('woonoow-settings'); - -// Add to WooCommerce settings -add_filter('woocommerce_general_settings', ...); -add_filter('woocommerce_settings_tabs_array', ...); -``` - -### Step 4: Redirect -```php -// Redirect old URL to new location -add_action('admin_init', function() { - if (isset($_GET['page']) && $_GET['page'] === 'woonoow-settings') { - wp_redirect(admin_url('admin.php?page=wc-settings&tab=general')); - exit; - } -}); -``` - ---- - -## Conclusion - -**No separate "WooNooW Settings" page needed.** - -Instead: -1. โœ… Integrate into existing WooCommerce settings tabs by context -2. โœ… Add "Admin UI" tab for WooNooW-specific UI settings -3. โœ… Provide settings API for addons -4. โœ… Keep settings contextual and intuitive - -**Result:** -- Seamless integration -- Better UX -- No clutter -- Familiar to users - -**WooNooW feels like a native part of WooCommerce, not a separate plugin.** diff --git a/SETTINGS_TREE_PLAN.md b/SETTINGS_TREE_PLAN.md deleted file mode 100644 index 3d9c51c..0000000 --- a/SETTINGS_TREE_PLAN.md +++ /dev/null @@ -1,899 +0,0 @@ -# WooNooW Settings Tree - Implementation Plan - -## ๐Ÿ“‹ Overview - -This document defines the complete settings structure for WooNooW Admin SPA, using a **Shopify-inspired approach** that focuses on store success rather than technical configuration. - ---- - -## ๐ŸŽฏ Strategy: Modern SaaS Approach (Shopify-Inspired) - -**Philosophy:** -- **Store-first, not tech-first** - Settings encourage business growth -- **Simple, fast, smooth** - Better UX than WooCommerce's complex tabs -- **Logical grouping** - Our own hierarchy, not WooCommerce's legacy structure -- **Progressive disclosure** - Show what matters, hide complexity -- **Action-oriented** - "Set up payments" not "Payment gateway settings" - -**Key Differences from WooCommerce:** -- โŒ No confusing tabs and sub-tabs -- โŒ No technical jargon -- โŒ No overwhelming forms -- โœ… Clear sections with visual cards -- โœ… Setup wizards for complex tasks -- โœ… Inline help and examples -- โœ… Mobile-friendly interface - ---- - -## ๐ŸŒฒ Settings Tree Structure (Shopify-Inspired) - -``` -Settings -โ”œโ”€โ”€ ๐Ÿช Store Details -โ”‚ โ””โ”€โ”€ /settings/store -โ”‚ โ€ข Store name, contact info -โ”‚ โ€ข Store address (for invoices, shipping origin) -โ”‚ โ€ข Currency & formatting -โ”‚ โ€ข Timezone & units -โ”‚ โ€ข Store industry/type -โ”‚ -โ”œโ”€โ”€ ๐Ÿ’ณ Payments -โ”‚ โ””โ”€โ”€ /settings/payments -โ”‚ โ€ข Payment providers (cards: Stripe, PayPal, etc.) -โ”‚ โ€ข Manual methods (bank transfer, cash, check) -โ”‚ โ€ข Payment capture settings -โ”‚ โ€ข Test mode toggle -โ”‚ -โ”œโ”€โ”€ ๐Ÿ“ฆ Shipping & Delivery -โ”‚ โ””โ”€โ”€ /settings/shipping -โ”‚ โ€ข Shipping zones (visual map) -โ”‚ โ€ข Shipping rates (simple table) -โ”‚ โ€ข Local pickup options -โ”‚ โ€ข Free shipping rules -โ”‚ โ€ข Delivery time estimates -โ”‚ -โ”œโ”€โ”€ ๐Ÿ’ฐ Taxes -โ”‚ โ””โ”€โ”€ /settings/taxes -โ”‚ โ€ข Tax calculation (auto or manual) -โ”‚ โ€ข Tax rates by region (simple table) -โ”‚ โ€ข Tax-inclusive pricing toggle -โ”‚ โ€ข Tax exemptions -โ”‚ -โ”œโ”€โ”€ ๐Ÿ›๏ธ Checkout -โ”‚ โ””โ”€โ”€ /settings/checkout -โ”‚ โ€ข Checkout fields (required/optional) -โ”‚ โ€ข Guest checkout toggle -โ”‚ โ€ข Account creation options -โ”‚ โ€ข Order notes -โ”‚ โ€ข Terms & conditions -โ”‚ -โ”œโ”€โ”€ ๐Ÿ‘ค Customer Accounts -โ”‚ โ””โ”€โ”€ /settings/customers -โ”‚ โ€ข Account creation settings -โ”‚ โ€ข Login options -โ”‚ โ€ข Customer data retention -โ”‚ โ€ข Privacy policy -โ”‚ -โ”œโ”€โ”€ ๐Ÿ“ง Notifications -โ”‚ โ””โ”€โ”€ /settings/notifications -โ”‚ โ€ข Email templates (visual editor) -โ”‚ โ€ข Order notifications (customer & admin) -โ”‚ โ€ข Shipping notifications -โ”‚ โ€ข Email sender details -โ”‚ โ€ข SMS notifications (future) -โ”‚ -โ”œโ”€โ”€ ๐ŸŽจ Brand & Appearance -โ”‚ โ””โ”€โ”€ /settings/brand -โ”‚ โ€ข Logo upload -โ”‚ โ€ข Brand colors -โ”‚ โ€ข Email header/footer -โ”‚ โ€ข Invoice template -โ”‚ -โ”œโ”€โ”€ ๐Ÿ”ง WooNooW Settings -โ”‚ โ””โ”€โ”€ /settings/woonoow -โ”‚ โ€ข Plugin preferences -โ”‚ โ€ข Performance settings -โ”‚ โ€ข Feature toggles -โ”‚ โ€ข License & updates -โ”‚ -โ”œโ”€โ”€ โš™๏ธ Advanced (Bridge to wp-admin) -โ”‚ โ””โ”€โ”€ /wp-admin/admin.php?page=wc-settings&tab=advanced -โ”‚ -โ”œโ”€โ”€ ๐Ÿ”Œ Integrations (Bridge to wp-admin) -โ”‚ โ””โ”€โ”€ /wp-admin/admin.php?page=wc-settings&tab=integration -โ”‚ -โ”œโ”€โ”€ ๐Ÿ” System Status (Bridge to wp-admin) -โ”‚ โ””โ”€โ”€ /wp-admin/admin.php?page=wc-status -โ”‚ -โ””โ”€โ”€ ๐Ÿงฉ Extensions (Bridge to wp-admin) - โ””โ”€โ”€ /wp-admin/admin.php?page=wc-addons -``` - ---- - -## ๐Ÿ“Š Implementation Priority (Shopify-Inspired) - -### **Phase 1: Foundation (HIGH PRIORITY)** ๐Ÿ”ด - -#### 1. Store Details (`/settings/store`) -**Purpose:** Core store information - the foundation of everything -**Complexity:** Low-Medium -**Estimated Time:** 4-6 hours -**Shopify Equivalent:** Settings > General - -**Layout:** Single-page form with clear sections - -**Sections:** - -**A. Store Identity** -- Store name (text input with live preview) -- Contact email (for customer inquiries) -- Customer support email (separate from admin) -- Store phone number (optional) - -**B. Store Address** -- Country/Region (dropdown with flags) -- Street address (autocomplete) -- City, State/Province, Postal code -- _Used for: shipping origin, invoices, tax calculations_ - -**C. Currency & Formatting** -- Currency (searchable dropdown with symbols) -- Currency position (before/after amount) -- Thousand separator (`,` or `.` or space) -- Decimal separator (`.` or `,`) -- Number of decimals (0-4) -- _Live preview: $1,234.56_ - -**D. Standards & Formats** -- Timezone (auto-detect with manual override) -- Unit system (Metric / Imperial) -- Weight unit (kg, g, lb, oz) -- Dimension unit (cm, m, in, ft) - -**E. Store Type** (helps with recommendations) -- Industry (dropdown: Fashion, Electronics, Food, etc.) -- Business type (B2C, B2B, Both) - -**UI/UX:** -- Clean, spacious layout -- Inline validation -- Live preview for currency formatting -- Auto-save draft (save button at top) -- "Your store is located in Indonesia ๐Ÿ‡ฎ๐Ÿ‡ฉ" summary card - ---- - -#### 2. Payments (`/settings/payments`) -**Purpose:** Get paid - make it dead simple -**Complexity:** Medium -**Estimated Time:** 6-8 hours -**Shopify Equivalent:** Settings > Payments - -**Layout:** Card-based interface, not a table - -**Sections:** - -**A. Payment Providers** (Visual Cards) -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ ๐Ÿ’ณ Credit & Debit Cards โ”‚ -โ”‚ โ”‚ -โ”‚ [Stripe Logo] Stripe Payments โ”‚ -โ”‚ โ—‹ Not connected โ”‚ -โ”‚ [Set up Stripe] button โ”‚ -โ”‚ โ”‚ -โ”‚ Accept Visa, Mastercard, Amex โ”‚ -โ”‚ 2.9% + $0.30 per transaction โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ [PayPal Logo] PayPal โ”‚ -โ”‚ โ— Connected โ”‚ -โ”‚ [Manage] [Disconnect] โ”‚ -โ”‚ โ”‚ -โ”‚ buyer@example.com โ”‚ -โ”‚ 3.49% + fixed fee per transaction โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ -``` - -**B. Manual Payment Methods** (Simpler cards) -- Bank Transfer (BACS) - toggle + instructions field -- Cash on Delivery - toggle + fee option -- Check Payments - toggle + instructions - -**C. Payment Settings** -- Test mode (big toggle with warning banner) -- Payment capture (Authorize only / Authorize and capture) -- Accepted payment methods (checkboxes with icons) - -**UI/UX:** -- Big, visual cards (not boring table rows) -- "Add payment provider" button with modal -- Setup wizard for Stripe/PayPal (not raw API keys) -- Test mode banner: "โš ๏ธ Test Mode Active - No real charges" -- Drag to reorder (shows on checkout) - ---- - -#### 3. Shipping & Delivery (`/settings/shipping`) -**Purpose:** Get products to customers -**Complexity:** Medium-High -**Estimated Time:** 8-10 hours -**Shopify Equivalent:** Settings > Shipping and delivery - -**Layout:** Zone-based with visual hierarchy - -**Sections:** - -**A. Shipping Zones** (Card list, not table) -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ ๐ŸŒ Domestic (Indonesia) โ”‚ -โ”‚ โ”‚ -โ”‚ Regions: All Indonesia โ”‚ -โ”‚ Rates: 3 shipping rates โ”‚ -โ”‚ โ”‚ -โ”‚ โ€ข Standard Shipping - Rp 15,000 โ”‚ -โ”‚ โ€ข Express Shipping - Rp 30,000 โ”‚ -โ”‚ โ€ข Free Shipping - Free (>Rp 500k) โ”‚ -โ”‚ โ”‚ -โ”‚ [Edit zone] [Delete] โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ ๐ŸŒ International โ”‚ -โ”‚ โ”‚ -โ”‚ Regions: Rest of world โ”‚ -โ”‚ Rates: 1 shipping rate โ”‚ -โ”‚ โ”‚ -โ”‚ โ€ข International - Calculated โ”‚ -โ”‚ โ”‚ -โ”‚ [Edit zone] โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - -[+ Add shipping zone] button -``` - -**B. Zone Editor** (Modal or slide-over) -- Zone name -- Countries/Regions (multi-select with search) -- Shipping rates: - - Name (e.g., "Standard Shipping") - - Price (flat rate or calculated) - - Conditions (order total, weight, etc.) - - Transit time (e.g., "3-5 business days") - -**C. Local Pickup** -- Enable local pickup (toggle) -- Pickup locations (list with add/edit) -- Pickup instructions - -**D. Shipping Settings** -- Show delivery estimates (toggle) -- Require shipping address (toggle) -- Hide shipping costs until address entered (toggle) - -**UI/UX:** -- Visual zone cards, not boring table -- "Add rate" button per zone -- Inline rate editor (no page reload) -- Drag to reorder rates -- Smart defaults: "Domestic" zone auto-created -- Map visualization (future enhancement) - ---- - -### **Phase 2: Customer Experience (MEDIUM PRIORITY)** ๐ŸŸก - -#### 4. Taxes (`/settings/taxes`) -**Purpose:** Handle taxes simply -**Complexity:** Medium -**Estimated Time:** 5-7 hours -**Shopify Equivalent:** Settings > Taxes and duties - -**Layout:** Simple toggle + table - -**Sections:** - -**A. Tax Collection** -- Collect taxes (big toggle) -- Prices include tax (toggle) -- Calculate tax based on (customer address / shop address) - -**B. Tax Rates** (Simple table, not WooCommerce's complex structure) -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ Region โ”‚ Rate โ”‚ Shippingโ”‚ Actions โ”‚ -โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค -โ”‚ Indonesia โ”‚ 11% โ”‚ โœ“ โ”‚ Edit โ”‚ -โ”‚ Singapore โ”‚ 9% โ”‚ โœ“ โ”‚ Edit โ”‚ -โ”‚ Malaysia โ”‚ 6% โ”‚ โœ“ โ”‚ Edit โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ -[+ Add tax rate] -``` - -**C. Tax Settings** -- Show tax breakdown at checkout (toggle) -- Tax exemptions (for wholesale, etc.) - -**UI/UX:** -- Auto-detect tax rates by country (suggest common rates) -- Simple table, not WooCommerce's confusing priority/compound system -- "Need help? We can set this up for you" link - ---- - -#### 5. Checkout (`/settings/checkout`) -**Purpose:** Optimize the buying experience -**Complexity:** Low-Medium -**Estimated Time:** 4-5 hours -**Shopify Equivalent:** Settings > Checkout - -**Layout:** Toggle-heavy with smart defaults - -**Sections:** - -**A. Customer Information** -- Company name (Show / Hide / Optional) -- Phone number (Required / Optional / Hidden) -- Address line 2 (Show / Hide) - -**B. Checkout Options** -- Guest checkout (toggle - default ON) -- Account creation at checkout (toggle) -- Order notes field (toggle) -- Marketing opt-in checkbox (toggle) - -**C. Order Processing** -- Terms and conditions (toggle + page selector) -- Privacy policy (toggle + page selector) -- Automatically complete orders (for digital products) - -**UI/UX:** -- Live preview of checkout form -- Smart defaults (guest checkout ON, company name optional) -- "Recommended" badges on best practices - ---- - -#### 6. Customer Accounts (`/settings/customers`) -**Purpose:** Customer login and data -**Complexity:** Low -**Estimated Time:** 3-4 hours -**Shopify Equivalent:** Settings > Customer accounts - -**Layout:** Simple toggles and options - -**Sections:** - -**A. Account Creation** -- Customers can create accounts (toggle) -- Account creation locations: - - โ˜‘ During checkout - - โ˜‘ On "My Account" page - - โ˜ Require accounts to purchase - -**B. Login Options** -- Email or username (radio) -- Social login (future: Google, Facebook) -- Password requirements (dropdown: None / Medium / Strong) - -**C. Customer Data** -- Data retention period (dropdown: Forever / 1 year / 2 years / 3 years) -- Download data retention (dropdown: Forever / 6 months / 1 year) -- Privacy policy page (page selector) - -**UI/UX:** -- Clear explanations for GDPR compliance -- "Learn about data privacy" help links - ---- - -### **Phase 3: Communication & Branding (MEDIUM PRIORITY)** ๐ŸŸก - -#### 7. Notifications (`/settings/notifications`) -**Purpose:** Keep customers informed -**Complexity:** Medium -**Estimated Time:** 6-8 hours -**Shopify Equivalent:** Settings > Notifications - -**Layout:** Email list + visual editor - -**Sections:** - -**A. Customer Notifications** (Card list with toggle) -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ โ— Order confirmation โ”‚ -โ”‚ Sent when order is placed โ”‚ -โ”‚ [Edit template] โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ โ— Shipping confirmation โ”‚ -โ”‚ Sent when order is shipped โ”‚ -โ”‚ [Edit template] โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ โ—‹ Order cancelled โ”‚ -โ”‚ Sent when order is cancelled โ”‚ -โ”‚ [Edit template] โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ -``` - -**B. Admin Notifications** -- New order (toggle + recipients) -- Low stock alert (toggle + threshold) -- Failed payment (toggle) - -**C. Email Settings** -- Sender name (e.g., "WooNooW Store") -- Sender email (e.g., "noreply@yourstore.com") -- Email footer text - -**D. Template Editor** (Per email, modal/slide-over) -- Subject line (with variables: {{order_number}}, {{customer_name}}) -- Email heading -- Body content (rich text editor) -- Live preview (desktop + mobile) - -**UI/UX:** -- Visual email builder (not raw HTML) -- Variable picker (click to insert {{customer_name}}) -- Send test email button -- Mobile preview - ---- - -#### 8. Brand & Appearance (`/settings/brand`) -**Purpose:** Make it yours -**Complexity:** Low-Medium -**Estimated Time:** 4-5 hours -**Shopify Equivalent:** Settings > Brand (new in Shopify) - -**Layout:** Visual, design-focused - -**Sections:** - -**A. Logo & Colors** -- Store logo (upload, max 500KB) -- Brand color (color picker) -- Accent color (color picker) -- _Used in: emails, invoices, admin interface_ - -**B. Email Design** -- Email header image (upload) -- Email background color -- Email text color -- Footer text (e.g., "ยฉ 2025 Your Store") - -**C. Invoice Template** -- Invoice logo (use store logo / upload different) -- Invoice header text -- Invoice footer text -- Tax ID / Business registration number - -**UI/UX:** -- Live preview of email with your branding -- Live preview of invoice -- Color picker with presets -- Image cropper for logo - ---- - -### **Phase 4: Advanced (KEEP IN WP-ADMIN)** โšช - -These settings are rarely used and can remain in wp-admin: - -#### 8. Advanced Settings (Bridge) -- Page setup (cart, checkout, my account, terms) -- REST API -- Webhooks -- Legacy API -- WooCommerce.com account - -#### 9. Integration Settings (Bridge) -- MaxMind Geolocation -- Other integrations - -#### 10. System Status (Bridge) -- System status report -- Tools (clear cache, regenerate thumbnails, etc.) -- Logs -- Scheduled actions - -#### 11. Extensions (Bridge) -- WooCommerce marketplace -- Browse extensions -- My subscriptions - ---- - -## ๐Ÿ”ง Technical Implementation - -### Backend (PHP) - -**Files to Create/Modify:** -1. `includes/Admin/Rest/SettingsController.php` - REST endpoints -2. `includes/Compat/SettingsProvider.php` - Settings data provider -3. `includes/Compat/NavigationRegistry.php` - โœ… Already updated - -**REST Endpoints:** -```php -GET /wp-json/woonoow/v1/settings/store -POST /wp-json/woonoow/v1/settings/store -GET /wp-json/woonoow/v1/settings/payments -POST /wp-json/woonoow/v1/settings/payments -GET /wp-json/woonoow/v1/settings/shipping -POST /wp-json/woonoow/v1/settings/shipping -GET /wp-json/woonoow/v1/settings/taxes -POST /wp-json/woonoow/v1/settings/taxes -GET /wp-json/woonoow/v1/settings/checkout -POST /wp-json/woonoow/v1/settings/checkout -GET /wp-json/woonoow/v1/settings/customers -POST /wp-json/woonoow/v1/settings/customers -GET /wp-json/woonoow/v1/settings/notifications -POST /wp-json/woonoow/v1/settings/notifications -GET /wp-json/woonoow/v1/settings/brand -POST /wp-json/woonoow/v1/settings/brand -``` - -**Data Flow:** -1. Frontend requests settings via REST API -2. Backend reads from WooCommerce options -3. Backend returns structured JSON -4. Frontend displays in form -5. User submits changes -6. Backend validates and saves to WooCommerce options -7. Frontend shows success/error - ---- - -### Frontend (React/TypeScript) - -**Files to Create:** -``` -admin-spa/src/routes/Settings/ -โ”œโ”€โ”€ index.tsx โœ… Done (WooNooW settings) -โ”œโ”€โ”€ Store.tsx โณ Store details (Shopify-style) -โ”œโ”€โ”€ Payments.tsx โณ Payment providers (card-based) -โ”œโ”€โ”€ Shipping.tsx โณ Shipping zones (visual cards) -โ”œโ”€โ”€ Taxes.tsx โณ Tax rates (simple table) -โ”œโ”€โ”€ Checkout.tsx โณ Checkout options -โ”œโ”€โ”€ Customers.tsx โณ Customer accounts -โ”œโ”€โ”€ Notifications.tsx โณ Email templates -โ”œโ”€โ”€ Brand.tsx โณ Branding & appearance -โ””โ”€โ”€ components/ - โ”œโ”€โ”€ SettingsLayout.tsx โณ Consistent layout wrapper - โ”œโ”€โ”€ SettingsCard.tsx โณ Card component (Shopify-style) - โ”œโ”€โ”€ SettingsSection.tsx โณ Section with heading - โ”œโ”€โ”€ ToggleField.tsx โณ Toggle switch - โ”œโ”€โ”€ PaymentProviderCard.tsx โณ Payment provider card - โ”œโ”€โ”€ ShippingZoneCard.tsx โณ Shipping zone card - โ”œโ”€โ”€ TaxRateTable.tsx โณ Simple tax table - โ”œโ”€โ”€ EmailTemplateCard.tsx โณ Email template card - โ”œโ”€โ”€ ColorPicker.tsx โณ Color picker - โ”œโ”€โ”€ ImageUploader.tsx โณ Image upload - โ””โ”€โ”€ LivePreview.tsx โณ Live preview component -``` - -**Shared Components:** -- Form wrapper with save/cancel -- Field renderer (text, select, checkbox, radio, textarea, color, image) -- Section headers -- Help text/tooltips -- Validation messages -- Loading states -- Success/error notifications - ---- - -## ๐ŸŽจ UI/UX Guidelines (Shopify-Inspired) - -### Visual Design -- **Card-based layout** - Not boring forms -- **Generous whitespace** - Breathable, not cramped -- **Visual hierarchy** - Clear sections with icons -- **Color-coded status** - Green (active), Gray (inactive), Yellow (test mode) -- **Illustrations** - Empty states, onboarding - -### Layout Patterns -- **Single-column on mobile** - Stack everything -- **Two-column on desktop** - Content + sidebar (for help/tips) -- **Sticky save bar** - Always visible at top -- **Progressive disclosure** - Show basics, hide advanced in expandable sections - -### Interactive Elements -- **Big toggle switches** - Not tiny checkboxes -- **Visual cards** - Payment providers, shipping zones as cards -- **Inline editing** - Edit in place, not separate pages -- **Drag and drop** - Reorder zones, rates, emails -- **Live previews** - Currency format, email templates, invoices - -### Forms & Validation -- **Smart defaults** - Pre-fill with best practices -- **Inline validation** - Real-time feedback -- **Help text everywhere** - Explain what each field does -- **Examples** - "e.g., Standard Shipping" -- **Recommended badges** - "โœ“ Recommended" for best practices - -### Feedback & States -- **Optimistic updates** - Show change immediately, save in background -- **Toast notifications** - "Settings saved" (not alerts) -- **Loading states** - Skeleton screens, not spinners -- **Empty states** - "No payment providers yet. Add one to get started." -- **Error states** - Friendly messages with solutions - -### Mobile-First -- **Touch-friendly** - 44px minimum tap targets -- **Swipe actions** - Swipe to delete/edit -- **Bottom sheets** - Modals slide from bottom on mobile -- **Responsive tables** - Stack columns on mobile - -### Accessibility -- **Keyboard navigation** - Tab through everything -- **Screen reader labels** - Descriptive ARIA labels -- **Focus indicators** - Clear blue outline -- **Color contrast** - WCAG AA compliant -- **Skip links** - Skip to main content - ---- - -## ๐Ÿ“ Implementation Checklist (Shopify-Inspired) - -### Phase 1: Foundation -- [ ] **Store Details** (`/settings/store`) - - [ ] Store identity section (name, emails, phone) - - [ ] Store address with autocomplete - - [ ] Currency selector with live preview - - [ ] Timezone & units - - [ ] Store type/industry - - [ ] Save/load functionality - -- [ ] **Payments** (`/settings/payments`) - - [ ] Payment provider cards (visual) - - [ ] Stripe/PayPal setup wizards - - [ ] Manual methods (bank, COD, check) - - [ ] Test mode toggle with banner - - [ ] Drag-and-drop ordering - - [ ] Save/load functionality - -- [ ] **Shipping & Delivery** (`/settings/shipping`) - - [ ] Shipping zone cards (visual) - - [ ] Zone editor (modal/slide-over) - - [ ] Rate configuration - - [ ] Local pickup options - - [ ] Drag-and-drop zones/rates - - [ ] Save/load functionality - -### Phase 2: Customer Experience -- [ ] **Taxes** (`/settings/taxes`) - - [ ] Tax collection toggle - - [ ] Simple tax rate table - - [ ] Auto-detect common rates - -- [ ] **Checkout** (`/settings/checkout`) - - [ ] Checkout field options - - [ ] Guest checkout toggle - - [ ] Terms & privacy - -- [ ] **Customer Accounts** (`/settings/customers`) - - [ ] Account creation settings - - [ ] Login options - - [ ] Data retention (GDPR) - -### Phase 3: Communication & Branding -- [ ] **Notifications** (`/settings/notifications`) - - [ ] Email template cards - - [ ] Visual email editor - - [ ] Variable picker - - [ ] Live preview - -- [ ] **Brand & Appearance** (`/settings/brand`) - - [ ] Logo uploader - - [ ] Color pickers - - [ ] Email/invoice preview - ---- - -## ๐Ÿงช Testing Requirements - -### Functional Testing -- [ ] All fields save correctly -- [ ] Validation works -- [ ] Default values load -- [ ] Changes persist after reload -- [ ] Bridge links work -- [ ] Mobile responsive - -### Integration Testing -- [ ] WooCommerce compatibility -- [ ] 3rd party gateway support -- [ ] Plugin conflict testing -- [ ] Multi-currency support - -### User Testing -- [ ] Intuitive navigation -- [ ] Clear labels -- [ ] Helpful error messages -- [ ] Fast performance - ---- - -## ๐Ÿ“š Documentation - -### User Documentation -- Settings overview -- Field descriptions -- Common configurations -- Troubleshooting - -### Developer Documentation -- API endpoints -- Filter hooks -- Extension points -- Code examples - ---- - -## ๐Ÿ”„ Migration Notes - -**No data migration needed!** -- All settings use WooCommerce's native options -- Deactivating WooNooW restores wp-admin settings -- No data loss risk - ---- - -## ๐ŸŽฏ Success Metrics (Shopify-Inspired) - -### Phase 1 Complete When: -- โœ… Store, Payments, Shipping pages functional -- โœ… Visual card-based UI (not boring forms) -- โœ… All fields save/load correctly -- โœ… Live previews working (currency, etc.) -- โœ… Mobile responsive with touch-friendly UI -- โœ… No console errors -- โœ… Feels like Shopify (fast, smooth, delightful) - -### Phase 2 Complete When: -- โœ… Taxes, Checkout, Customers pages functional -- โœ… Simple tables (not WooCommerce complexity) -- โœ… All validations working -- โœ… Smart defaults applied -- โœ… Performance acceptable (<2s load) - -### Phase 3 Complete When: -- โœ… Notifications, Brand pages functional -- โœ… Visual email editor working -- โœ… Live email/invoice preview -- โœ… Color pickers, image uploaders working -- โœ… Template customization working - ---- - -## ๐Ÿ“… Timeline Estimate (Shopify-Inspired Approach) - -| Phase | Pages | Estimated Time | Priority | -|-------|-------|----------------|----------| -| **Phase 1: Foundation** | Store, Payments, Shipping | 18-24 hours | ๐Ÿ”ด HIGH | -| **Phase 2: Customer Experience** | Taxes, Checkout, Customers | 12-16 hours | ๐ŸŸก MEDIUM | -| **Phase 3: Communication & Branding** | Notifications, Brand | 10-13 hours | ๐ŸŸก MEDIUM | -| **Total** | **8 pages** | **40-53 hours** | | - -**Breakdown:** -- **Store Details:** 4-6 hours (simple, but needs autocomplete & live preview) -- **Payments:** 6-8 hours (card UI, setup wizards, drag-drop) -- **Shipping:** 8-10 hours (zone cards, rate editor, complex) -- **Taxes:** 5-7 hours (simple table, auto-detect) -- **Checkout:** 4-5 hours (toggles, live preview) -- **Customers:** 3-4 hours (simple toggles) -- **Notifications:** 6-8 hours (email editor, preview) -- **Brand:** 4-5 hours (color pickers, image upload, preview) - -**Note:** Times include: -- UI design (Shopify-style cards, not forms) -- Component development (reusable) -- Backend API integration -- Testing (functional + UX) -- Documentation - ---- - -## ๐Ÿ”— Related Documents - -- `PROGRESS_NOTE.md` - Development progress -- `SPA_ADMIN_MENU_PLAN.md` - Menu structure -- `PROJECT_SOP.md` - Development standards -- `STANDALONE_MODE_SUMMARY.md` - Mode documentation -- `MENU_FIX_SUMMARY.md` - Navigation fix details - ---- - -## ๐Ÿ“Š WooCommerce vs WooNooW Settings Comparison - -| Aspect | WooCommerce | WooNooW (Shopify-Inspired) | -|--------|-------------|----------------------------| -| **Layout** | Tabs within tabs | Single pages with cards | -| **Navigation** | Confusing hierarchy | Flat, clear menu | -| **Forms** | Dense, technical | Spacious, visual | -| **Payment Setup** | Raw API keys | Setup wizards | -| **Shipping** | Complex table | Visual zone cards | -| **Taxes** | Priority/compound system | Simple rate table | -| **Emails** | HTML code editor | Visual template builder | -| **Branding** | Scattered settings | Dedicated Brand page | -| **Mobile** | Not optimized | Touch-friendly | -| **Help** | External docs | Inline help everywhere | -| **Defaults** | Empty/technical | Smart, business-focused | -| **Feel** | Admin panel | Modern SaaS app | - ---- - -## ๐Ÿ’ก Key Design Decisions - -### 1. **Store Details Instead of General** -- **Why:** "General" is vague. "Store Details" is clear and action-oriented. -- **Benefit:** Merchants know exactly what to expect. - -### 2. **Card-Based Payment Providers** -- **Why:** Visual cards are more engaging than table rows. -- **Benefit:** Easier to scan, understand status at a glance. - -### 3. **Shipping Zones as Cards** -- **Why:** WooCommerce's table is overwhelming. -- **Benefit:** Visual hierarchy, easier to manage multiple zones. - -### 4. **Simple Tax Table** -- **Why:** WooCommerce's priority/compound system confuses users. -- **Benefit:** 90% of stores just need region + rate. - -### 5. **Separate Checkout & Customer Pages** -- **Why:** WooCommerce lumps them together. -- **Benefit:** Clearer separation of concerns. - -### 6. **Notifications Instead of Emails** -- **Why:** "Notifications" is more modern and broader (future: SMS, push). -- **Benefit:** Future-proof naming. - -### 7. **Brand & Appearance Page** -- **Why:** Shopify's newest addition, highly requested. -- **Benefit:** One place for all branding (logo, colors, templates). - -### 8. **Progressive Disclosure** -- **Why:** Don't overwhelm with all options at once. -- **Benefit:** Show basics, hide advanced in expandable sections. - ---- - -## ๐Ÿš€ Implementation Strategy - -### Week 1-2: Foundation (Phase 1) -1. **Store Details** - Get the basics right -2. **Payments** - Critical for business -3. **Shipping** - Most complex, tackle early - -### Week 3: Customer Experience (Phase 2) -4. **Taxes** - Simpler than WooCommerce -5. **Checkout** - Quick wins with toggles -6. **Customers** - Simple settings - -### Week 4: Polish (Phase 3) -7. **Notifications** - Email templates -8. **Brand** - Visual polish - -### Ongoing: Iteration -- User feedback -- Performance optimization -- Mobile refinement -- Accessibility audit - ---- - -**Last Updated:** November 5, 2025 -**Status:** ๐Ÿ“‹ Planning Complete - Shopify-Inspired Approach Adopted -**Strategy:** Store-first, visual, simple, fast -**Next Step:** Implement Phase 1 - Store Details page -**Estimated Total:** 40-53 hours for all 8 pages diff --git a/SPA_ADMIN_MENU_PLAN.md b/SPA_ADMIN_MENU_PLAN.md deleted file mode 100644 index f9743ac..0000000 --- a/SPA_ADMIN_MENU_PLAN.md +++ /dev/null @@ -1,253 +0,0 @@ -# WooNooW โ€” Single Source of Truth for WooCommerce Admin Menus โ†’ SPA Routes - -This document enumerates the **default WooCommerce admin menus & submenus** (no addโ€‘ons) and defines how each maps to our **SPA routes**. It is the canonical reference for nav generation and routing. - -> Scope: WordPress **wpโ€‘admin** defaults from WooCommerce core and WooCommerce Admin (Analytics/Marketing). Addโ€‘ons will be collected dynamically at runtime and handled separately. - ---- - -## Legend -- **WP Admin**: the native admin path/slug WooCommerce registers -- **Purpose**: what the screen is about -- **SPA Route**: our hash route (adminโ€‘spa), used by nav + router -- **Status**: - - **SPA** = fully replaced by a native SPA view - - **Bridge** = temporarily rendered in a legacy bridge (iframe) inside SPA - - **Planned** = route reserved, SPA view pending - ---- - -## Topโ€‘level: WooCommerce (`woocommerce`) - -| Menu | WP Admin | Purpose | SPA Route | Status | -|---|---|---|---|---| -| Home | `admin.php?page=wc-admin` | WC Admin home / activity | `/home` | Bridge (for now) | -| Orders | `edit.php?post_type=shop_order` | Order list & management | `/orders` | **SPA** | -| Add Order | `post-new.php?post_type=shop_order` | Create order | `/orders/new` | **SPA** | -| Customers | `admin.php?page=wc-admin&path=/customers` | Customer index | `/customers` | Planned | -| Coupons | `edit.php?post_type=shop_coupon` | Coupon list | `/coupons` | Planned | -| Settings | `admin.php?page=wc-settings` | Store settings (tabs) | `/settings` | Bridge (tabbed) | -| Status | `admin.php?page=wc-status` | System status/tools | `/status` | Bridge | -| Extensions | `admin.php?page=wc-addons` | Marketplace | `/extensions` | Bridge | - -> Notes -> - โ€œAdd Orderโ€ does not always appear as a submenu in all installs, but we expose `/orders/new` explicitly in SPA. -> - Some sites show **Reports** (classic) if WooCommerce Admin is disabled; we route that under `/reports` (Bridge) if present. - ---- - -## Topโ€‘level: Products (`edit.php?post_type=product`) - -| Menu | WP Admin | Purpose | SPA Route | Status | -|---|---|---|---|---| -| All Products | `edit.php?post_type=product` | Product catalog | `/products` | Planned | -| Add New | `post-new.php?post_type=product` | Create product | `/products/new` | Planned | -| Categories | `edit-tags.php?taxonomy=product_cat&post_type=product` | Category mgmt | `/products/categories` | Planned | -| Tags | `edit-tags.php?taxonomy=product_tag&post_type=product` | Tag mgmt | `/products/tags` | Planned | -| Attributes | `edit.php?post_type=product&page=product_attributes` | Attributes mgmt | `/products/attributes` | Planned | - ---- - -## Topโ€‘level: Analytics (`admin.php?page=wc-admin&path=/analytics/overview`) - -| Menu | WP Admin | Purpose | SPA Route | Status | -|---|---|---|---|---| -| Overview | `admin.php?page=wc-admin&path=/analytics/overview` | KPIs dashboard | `/analytics/overview` | Bridge | -| Revenue | `admin.php?page=wc-admin&path=/analytics/revenue` | Revenue report | `/analytics/revenue` | Bridge | -| Orders | `admin.php?page=wc-admin&path=/analytics/orders` | Orders report | `/analytics/orders` | Bridge | -| Products | `admin.php?page=wc-admin&path=/analytics/products` | Products report | `/analytics/products` | Bridge | -| Categories | `admin.php?page=wc-admin&path=/analytics/categories` | Categories report | `/analytics/categories` | Bridge | -| Coupons | `admin.php?page=wc-admin&path=/analytics/coupons` | Coupons report | `/analytics/coupons` | Bridge | -| Taxes | `admin.php?page=wc-admin&path=/analytics/taxes` | Taxes report | `/analytics/taxes` | Bridge | -| Downloads | `admin.php?page=wc-admin&path=/analytics/downloads` | Downloads report | `/analytics/downloads` | Bridge | -| Stock | `admin.php?page=wc-admin&path=/analytics/stock` | Stock report | `/analytics/stock` | Bridge | -| Settings | `admin.php?page=wc-admin&path=/analytics/settings` | Analytics settings | `/analytics/settings` | Bridge | - -> Analytics entries are provided by **WooCommerce Admin**. We keep them accessible via a **Bridge** until replaced. - ---- - -## Topโ€‘level: Marketing (`admin.php?page=wc-admin&path=/marketing`) - -| Menu | WP Admin | Purpose | SPA Route | Status | -|---|---|---|---|---| -| Hub | `admin.php?page=wc-admin&path=/marketing` | Marketing hub | `/marketing` | Bridge | - ---- - -## Crossโ€‘reference for routing -When our SPA receives a `wp-admin` URL, map using these regex rules first; if no match, fall back to Legacy Bridge: - -```ts -// Admin URL โ†’ SPA route mapping -export const WC_ADMIN_ROUTE_MAP: Array<[RegExp, string]> = [ - [/edit\.php\?post_type=shop_order/i, '/orders'], - [/post-new\.php\?post_type=shop_order/i, '/orders/new'], - [/edit\.php\?post_type=product/i, '/products'], - [/post-new\.php\?post_type=product/i, '/products/new'], - [/edit-tags\.php\?taxonomy=product_cat/i, '/products/categories'], - [/edit-tags\.php\?taxonomy=product_tag/i, '/products/tags'], - [/product_attributes/i, '/products/attributes'], - [/wc-admin.*path=%2Fcustomers/i, '/customers'], - [/wc-admin.*path=%2Fanalytics%2Foverview/i, '/analytics/overview'], - [/wc-admin.*path=%2Fanalytics%2Frevenue/i, '/analytics/revenue'], - [/wc-admin.*path=%2Fanalytics%2Forders/i, '/analytics/orders'], - [/wc-admin.*path=%2Fanalytics%2Fproducts/i, '/analytics/products'], - [/wc-admin.*path=%2Fanalytics%2Fcategories/i, '/analytics/categories'], - [/wc-admin.*path=%2Fanalytics%2Fcoupons/i, '/analytics/coupons'], - [/wc-admin.*path=%2Fanalytics%2Ftaxes/i, '/analytics/taxes'], - [/wc-admin.*path=%2Fanalytics%2Fdownloads/i, '/analytics/downloads'], - [/wc-admin.*path=%2Fanalytics%2Fstock/i, '/analytics/stock'], - [/wc-admin.*path=%2Fanalytics%2Fsettings/i, '/analytics/settings'], - [/wc-admin.*page=wc-settings/i, '/settings'], - [/wc-status/i, '/status'], - [/wc-addons/i, '/extensions'], -]; -``` - -> Keep this map in sync with the SPA routers. New SPA screens should switch a routeโ€™s **Status** from Bridge โ†’ SPA. - ---- - -## Implementation notes -- **Nav Data**: The runtime menu collector already injects `window.WNM_WC_MENUS`. Use this file as the *static* canonical mapping and the collector data as the *dynamic* source for what exists in a given site. -- **Hidden WPโ€‘Admin**: wpโ€‘admin menus will be hidden in final builds; all entries must be reachable via SPA. -- **Capabilities**: Respect `capability` from WP when we later enforce perโ€‘user visibility. For now, the collector includes only titles/links. -- **Customers & Coupons**: Some installs place these differently. Our SPA routes should remain stable; mapping rules above handle variants. - ---- - - -## Current SPA coverage (at a glance) -- **Orders** (list/new/edit/show) โ†’ SPA โœ… -- **Products** (catalog/new/attributes/categories/tags) โ†’ Planned -- **Customers, Coupons, Analytics, Marketing, Settings, Status, Extensions** โ†’ Bridge โ†’ SPA gradually - ---- - -## Visual Menu Tree (Default WooCommerce Admin) - -This tree mirrors what appears in the WordPress admin sidebar for a default WooCommerce installation โ€” excluding addโ€‘ons. - -```text -WooCommerce -โ”œโ”€โ”€ Home (wc-admin) -โ”œโ”€โ”€ Orders -โ”‚ โ”œโ”€โ”€ All Orders -โ”‚ โ””โ”€โ”€ Add Order -โ”œโ”€โ”€ Customers -โ”œโ”€โ”€ Coupons -โ”œโ”€โ”€ Reports (deprecated classic) [may not appear if WC Admin enabled] -โ”œโ”€โ”€ Settings -โ”‚ โ”œโ”€โ”€ General -โ”‚ โ”œโ”€โ”€ Products -โ”‚ โ”œโ”€โ”€ Tax -โ”‚ โ”œโ”€โ”€ Shipping -โ”‚ โ”œโ”€โ”€ Payments -โ”‚ โ”œโ”€โ”€ Accounts & Privacy -โ”‚ โ”œโ”€โ”€ Emails -โ”‚ โ”œโ”€โ”€ Integration -โ”‚ โ””โ”€โ”€ Advanced -โ”œโ”€โ”€ Status -โ”‚ โ”œโ”€โ”€ System Status -โ”‚ โ”œโ”€โ”€ Tools -โ”‚ โ”œโ”€โ”€ Logs -โ”‚ โ””โ”€โ”€ Scheduled Actions -โ””โ”€โ”€ Extensions - -Products -โ”œโ”€โ”€ All Products -โ”œโ”€โ”€ Add New -โ”œโ”€โ”€ Categories -โ”œโ”€โ”€ Tags -โ””โ”€โ”€ Attributes - -Analytics (WooCommerce Admin) -โ”œโ”€โ”€ Overview -โ”œโ”€โ”€ Revenue -โ”œโ”€โ”€ Orders -โ”œโ”€โ”€ Products -โ”œโ”€โ”€ Categories -โ”œโ”€โ”€ Coupons -โ”œโ”€โ”€ Taxes -โ”œโ”€โ”€ Downloads -โ”œโ”€โ”€ Stock -โ””โ”€โ”€ Settings - -Marketing -โ””โ”€โ”€ Hub -``` - -> Use this as a structural reference for navigation hierarchy when rendering nested navs in SPA (e.g., hover or sidebar expansion). - - -## Proposed SPA Main Menu (Authoritative) -This replaces wpโ€‘admin's structure with a focused SPA hierarchy. Analytics & Marketing are folded into **Dashboard**. **Status** and **Extensions** live under **Settings**. - -**Note:** Settings submenu is **only visible in Standalone Mode** (`/admin`). In normal wp-admin mode, users access WooCommerce settings through the standard WordPress admin interface. - -```text -Dashboard -โ”œโ”€โ”€ Overview (/dashboard) โ† default landing -โ”œโ”€โ”€ Revenue (/dashboard/revenue) -โ”œโ”€โ”€ Orders (/dashboard/orders) -โ”œโ”€โ”€ Products (/dashboard/products) -โ”œโ”€โ”€ Categories (/dashboard/categories) -โ”œโ”€โ”€ Coupons (/dashboard/coupons) -โ”œโ”€โ”€ Taxes (/dashboard/taxes) -โ”œโ”€โ”€ Downloads (/dashboard/downloads) -โ””โ”€โ”€ Stock (/dashboard/stock) - -Orders -โ”œโ”€โ”€ All Orders (/orders) -โ””โ”€โ”€ Add Order (/orders/new) - -Products -โ”œโ”€โ”€ All Products (/products) -โ”œโ”€โ”€ Add New (/products/new) -โ”œโ”€โ”€ Categories (/products/categories) -โ”œโ”€โ”€ Tags (/products/tags) -โ””โ”€โ”€ Attributes (/products/attributes) - -Coupons -โ””โ”€โ”€ All Coupons (/coupons) - -Customers -โ””โ”€โ”€ All Customers (/customers) - (Customers are derived from orders + user profiles; nonโ€‘buyers are excluded by default.) - -Settings (Standalone Mode Only) -โ”œโ”€โ”€ WooNooW (/settings) โ† plugin settings -โ”œโ”€โ”€ General (/settings/general) โ† SPA -โ”œโ”€โ”€ Payments (/settings/payments) โ† SPA -โ”œโ”€โ”€ Shipping (/settings/shipping) โ† SPA -โ”œโ”€โ”€ Products (/settings/products) โ† SPA -โ”œโ”€โ”€ Tax (/settings/tax) โ† SPA -โ”œโ”€โ”€ Accounts & Privacy (/settings/accounts) โ† SPA -โ”œโ”€โ”€ Emails (/settings/emails) โ† SPA -โ”œโ”€โ”€ Advanced (bridge to wp-admin) โ† Bridge -โ”œโ”€โ”€ Integration (bridge to wp-admin) โ† Bridge -โ”œโ”€โ”€ Status (bridge to wp-admin) โ† Bridge -โ””โ”€โ”€ Extensions (bridge to wp-admin) โ† Bridge -``` - -### Routing notes -- **Dashboard** subsumes Analytics & (most) Marketing metrics. Each item maps to a SPA page. Until built, these can open a Legacy Bridge view of the corresponding wcโ€‘admin screen. -- **Status** and **Extensions** are still reachable (now under Settings) and can bridge to `wc-status` and `wc-addons` until replaced. -- Existing map (`WC_ADMIN_ROUTE_MAP`) remains, but should redirect legacy URLs to the new SPA paths above. - ---- - -### What is โ€œMarketing / Hubโ€ in WooCommerce? -The **Marketing** (Hub) screen is part of **WooCommerce Admin**. It aggregates recommended extensions and campaign tools (e.g., MailPoet, Facebook/Google listings, coupon promos). Itโ€™s not essential for dayโ€‘toโ€‘day store ops. In WooNooW we fold campaign performance into **Dashboard** metrics; the extension browsing/management aspect is covered under **Settings โ†’ Extensions** (Bridge until native UI exists). - -### Customers in SPA -WooCommerceโ€™s wcโ€‘admin provides a Customers table; classic wpโ€‘admin does not. Our SPAโ€™s **Customers** pulls from **orders** + **user profiles** to show buyers. Nonโ€‘buyers are excluded by default (configurable later). Route: `/customers`. - ---- - -### Action items -- [ ] Update quickโ€‘nav to use this SPA menu tree for topโ€‘level buttons. -- [ ] Extend `WC_ADMIN_ROUTE_MAP` to point legacy analytics URLs to the new `/dashboard/*` paths. -- [ ] Implement `/dashboard/*` pages incrementally; use Legacy Bridge where needed. -- [ ] Keep `window.WNM_WC_MENUS` for addโ€‘on items (dynamic), nesting them under **Settings** or **Dashboard** as appropriate. \ No newline at end of file diff --git a/STANDALONE_ADMIN_SETUP.md b/STANDALONE_ADMIN_SETUP.md deleted file mode 100644 index 1a0dded..0000000 --- a/STANDALONE_ADMIN_SETUP.md +++ /dev/null @@ -1,135 +0,0 @@ -# ๐Ÿš€ Standalone Admin Setup Instructions - -## โœ… What's Implemented - -1. **Dashboard menu stays active** on all dashboard routes (Revenue, Orders, Products, etc.) -2. **Mobile topbar blur removed** - solid background on mobile for better readability -3. **Standalone admin system** ready at `/admin` path - ---- - -## ๐Ÿ“ Required: Add Rewrite Rule - -WordPress redirects `/admin` to `/wp-admin` by default. To enable standalone admin, add this to your **WordPress root `.htaccess`** file: - -### Location -`/Users/dwindown/Local Sites/woonoow/app/public/.htaccess` - -### Add BEFORE the WordPress rules - -```apache -# BEGIN WooNooW Standalone Admin - -RewriteEngine On -RewriteRule ^admin(/.*)?$ wp-content/plugins/woonoow/admin/index.php [L,QSA] - -# END WooNooW Standalone Admin - -# BEGIN WordPress -# ... existing WordPress rules ... -``` - -### Full Example - -```apache -# BEGIN WooNooW Standalone Admin - -RewriteEngine On -RewriteRule ^admin(/.*)?$ wp-content/plugins/woonoow/admin/index.php [L,QSA] - -# END WooNooW Standalone Admin - -# BEGIN WordPress - -RewriteEngine On -RewriteBase / -RewriteRule ^index\.php$ - [L] -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . /index.php [L] - -# END WordPress -``` - ---- - -## ๐Ÿงช Testing - -After adding the rewrite rule: - -1. **Test standalone admin:** - - Visit: `https://woonoow.local/admin` - - Should show WooNooW login page (if not logged in) - - Should show dashboard (if logged in) - -2. **Test wp-admin still works:** - - Visit: `https://woonoow.local/wp-admin/admin.php?page=woonoow` - - Should work normally - -3. **Test dashboard menu:** - - Click Dashboard โ†’ Revenue - - Dashboard menu should stay highlighted - - Click Dashboard โ†’ Orders - - Dashboard menu should still be highlighted - -4. **Test mobile view:** - - Open mobile view (or resize browser) - - Top navigation bar should be solid (not blurry) - ---- - -## ๐ŸŽฏ What's Different - -### Standalone Mode (`/admin`) -- โœ… No WordPress admin UI -- โœ… No theme CSS/JS -- โœ… No plugin scripts -- โœ… 10x smaller (~50KB vs ~500KB) -- โœ… 3-5x faster load time -- โœ… Custom login page -- โœ… App-like experience - -### WP-Admin Mode (`/wp-admin?page=woonoow`) -- โœ… Full WordPress admin -- โœ… Access to other plugins -- โœ… WordPress menu bar -- โœ… Compatible with all plugins -- โœ… Familiar interface - ---- - -## ๐Ÿ“Š Performance Comparison - -| Metric | wp-admin | /admin | Improvement | -|--------|----------|--------|-------------| -| Initial Load | ~500KB | ~50KB | **10x smaller** | -| Load Time | ~2s | ~0.5s | **4x faster** | -| Scripts | 20+ files | 2 files | **10x fewer** | -| WordPress UI | Yes | No | **Cleaner** | - ---- - -## ๐Ÿ”ง Files Modified - -1. **App.tsx** - Dashboard menu now uses `ActiveNavLink` with `startsWith="/dashboard"` -2. **App.tsx** - Mobile topbar blur removed (`bg-background` on mobile, blur only on desktop) -3. **AuthController.php** - Login/logout/check endpoints -4. **admin/index.php** - Standalone entry point -5. **Login.tsx** - SPA login page - ---- - -## โœ… Summary - -**Issue 1:** Dashboard menu active state โœ… FIXED -- Used existing `ActiveNavLink` pattern with `startsWith="/dashboard"` - -**Issue 2:** Mobile topbar blur โœ… FIXED -- Removed blur on mobile, kept on desktop for glassmorphism effect - -**Issue 3:** `/admin` redirects to `/wp-admin` โš ๏ธ NEEDS SETUP -- Add rewrite rule to WordPress root `.htaccess` (see above) - ---- - -**Next:** Add the rewrite rule and test! diff --git a/STANDALONE_MODE_SUMMARY.md b/STANDALONE_MODE_SUMMARY.md deleted file mode 100644 index 7ad1c1f..0000000 --- a/STANDALONE_MODE_SUMMARY.md +++ /dev/null @@ -1,235 +0,0 @@ -# WooNooW Standalone Mode - Complete Summary - -## ๐Ÿ“‹ Overview - -WooNooW now supports **three distinct admin interface modes**, providing flexibility for different workflows and use cases. - ---- - -## ๐ŸŽฏ Three Admin Modes - -### 1. **Normal Mode (wp-admin)** -- **URL:** `/wp-admin/admin.php?page=woonoow` -- **Layout:** WordPress admin sidebar + WooNooW SPA -- **Settings Submenu:** Hidden (use WooCommerce settings) -- **Use Case:** Traditional WordPress admin workflow - -### 2. **Fullscreen Mode** -- **Toggle:** Fullscreen button in header -- **Layout:** WooNooW SPA only (no WordPress chrome) -- **Settings Submenu:** Hidden -- **Use Case:** Focus mode for order processing - -### 3. **Standalone Mode** โœจ NEW -- **URL:** `https://yoursite.com/admin` -- **Layout:** Complete standalone application -- **Settings Submenu:** Visible with SPA settings pages -- **Use Case:** Quick daily access, mobile-friendly - ---- - -## ๐Ÿ” Standalone Mode Features - -### Authentication -- **Custom login page:** `/admin#/login` -- **WordPress integration:** Uses native WordPress authentication -- **Session persistence:** Login state shared across all modes -- **Logout:** Dedicated logout button in header - -### Navigation -- **"WordPress" button:** Quick access to wp-admin -- **Admin bar link:** Access standalone from wp-admin -- **Settings submenu:** Full settings navigation (standalone only) - -### Settings Structure (Option A - Everyday Use) -``` -Settings (Standalone Only) -โ”œโ”€โ”€ WooNooW (plugin settings) -โ”œโ”€โ”€ General (store settings) - SPA -โ”œโ”€โ”€ Payments (gateways) - SPA -โ”œโ”€โ”€ Shipping (zones, methods) - SPA -โ”œโ”€โ”€ Products (inventory) - SPA -โ”œโ”€โ”€ Tax (rates) - SPA -โ”œโ”€โ”€ Accounts & Privacy - SPA -โ”œโ”€โ”€ Emails (templates) - SPA -โ”œโ”€โ”€ Advanced - Bridge to wp-admin -โ”œโ”€โ”€ Integration - Bridge to wp-admin -โ”œโ”€โ”€ Status - Bridge to wp-admin -โ””โ”€โ”€ Extensions - Bridge to wp-admin -``` - -**Strategy:** Focus on most-used settings in SPA, bridge to wp-admin for advanced features. - ---- - -## ๐Ÿ”ง Technical Implementation - -### Backend Files - -**`includes/Admin/StandaloneAdmin.php`** -- Handles `/admin` and `/admin/` requests -- Renders standalone HTML template -- Localizes `WNW_CONFIG` with `standaloneMode: true` -- Provides authentication state and store settings - -**`includes/Admin/Menu.php`** -- Added admin bar link to standalone mode -- Icon: `dashicons-store` -- Capability: `manage_woocommerce` - -**`includes/Api/AuthController.php`** -- Login endpoint: `POST /wp-json/woonoow/v1/auth/login` -- Authentication sequence: - 1. `wp_authenticate()` - 2. `wp_clear_auth_cookie()` - 3. `wp_set_current_user()` - 4. `wp_set_auth_cookie()` - 5. `do_action('wp_login')` -- Ensures session persistence - -### Frontend Files - -**`admin-spa/src/App.tsx`** -- `AuthWrapper` component handles authentication -- Login/logout flow with page reload -- "WordPress" button (standalone only) -- "Logout" button (standalone only) - -**`admin-spa/src/routes/Login.tsx`** -- Custom login form -- Username/password authentication -- Page reload after login to pick up cookies/nonces - -**`admin-spa/src/nav/tree.ts`** -- Dynamic settings submenu using getter -- Only shows in standalone mode: -```typescript -get children() { - const isStandalone = (window as any).WNW_CONFIG?.standaloneMode; - if (!isStandalone) return []; - return [ /* settings items */ ]; -} -``` - -**`admin-spa/src/routes/Settings/`** -- `index.tsx` - WooNooW settings -- `General.tsx` - General settings placeholder -- `Payments.tsx` - Payment settings placeholder -- `Shipping.tsx` - Shipping settings placeholder - ---- - -## ๐Ÿ”„ Mode Switching - -### From wp-admin to Standalone -1. Click "WooNooW" in admin bar -2. Opens `/admin` in same tab -3. Session persists - -### From Standalone to wp-admin -1. Click "WordPress" button in header -2. Opens `/wp-admin` in same tab -3. Session persists - -### To Fullscreen -- Click fullscreen toggle in any mode -- Maximizes workspace - ---- - -## ๐Ÿงช Testing Checklist - -### Authentication -- [ ] Login via standalone works -- [ ] Session persists to wp-admin -- [ ] Logout from standalone works -- [ ] Logout from wp-admin affects standalone - -### Navigation -- [ ] "WordPress" button opens wp-admin -- [ ] Admin bar link opens standalone -- [ ] Settings submenu only shows in standalone -- [ ] Dashboard path is `/dashboard` - -### Settings -- [ ] WooNooW settings page loads -- [ ] General settings page loads -- [ ] Payments settings page loads -- [ ] Shipping settings page loads -- [ ] Bridge links work (Advanced, Integration, Status, Extensions) - ---- - -## ๐Ÿ“š Documentation Updated - -1. **PROJECT_BRIEF.md** - Updated Phase 4 description -2. **PROGRESS_NOTE.md** - Added complete standalone mode section -3. **SPA_ADMIN_MENU_PLAN.md** - Updated settings structure -4. **PROJECT_SOP.md** - Added Section 7: Admin Interface Modes -5. **README.md** - Added three modes overview -6. **STANDALONE_MODE_SUMMARY.md** - This document - ---- - -## ๐ŸŽฏ Next Steps - -### Phase 1: Core Settings (Priority) -1. **General Settings** - Store address, currency, units -2. **Payment Settings** - Gateway list with enable/disable -3. **Shipping Settings** - Zones, methods, rates - -### Phase 2: Product & Customer Settings -4. **Product Settings** - Inventory, downloadable products -5. **Tax Settings** - Tax rates and classes -6. **Accounts Settings** - Registration, privacy options - -### Phase 3: Communication -7. **Email Settings** - Email templates and settings - -### Phase 4: Advanced (Keep in wp-admin) -- Advanced settings -- Integration settings -- System status -- Extensions - ---- - -## ๐Ÿ’ก Design Decisions - -### Why Settings Submenu Only in Standalone? -- **Normal mode:** Users have full WordPress admin access, use WooCommerce settings -- **Fullscreen mode:** Focus on tasks, not configuration -- **Standalone mode:** Complete app experience, needs settings access - -### Why Option A (Everyday Use)? -- โœ… Faster development - Focus on most-used features -- โœ… Better UX - Quick access to daily tasks -- โœ… Less maintenance - Don't duplicate everything -- โœ… Coexist with WooCommerce - Users can still access advanced settings -- โœ… Extensible - 3rd party plugins can hook into settings - -### Why Dynamic Getter for Settings? -- Evaluated at runtime, not module load time -- Ensures correct mode detection -- Clean implementation without conditionals everywhere - ---- - -## ๐Ÿ” Key Files Reference - -### Backend -- `includes/Admin/StandaloneAdmin.php` - Standalone routing and rendering -- `includes/Admin/Menu.php` - Admin bar link -- `includes/Api/AuthController.php` - Login/logout endpoints - -### Frontend -- `admin-spa/src/App.tsx` - Main app, auth wrapper, header -- `admin-spa/src/routes/Login.tsx` - Login form -- `admin-spa/src/nav/tree.ts` - Navigation structure -- `admin-spa/src/routes/Settings/` - Settings pages - ---- - -**Implementation Date:** November 5, 2025 -**Status:** โœ… Production Ready -**Next Milestone:** Implement General/Payments/Shipping settings pages diff --git a/TASKS_SUMMARY.md b/TASKS_SUMMARY.md new file mode 100644 index 0000000..25f8b51 --- /dev/null +++ b/TASKS_SUMMARY.md @@ -0,0 +1,130 @@ +# Tasks Summary - November 11, 2025 + +## โœ… Task 1: Translation Support Audit + +### Status: COMPLETED โœ“ + +**Findings:** +- Most settings pages already have `__` translation function imported +- **Missing translation support:** + - `Store.tsx` - Needs `__` import and string wrapping + - `Payments.tsx` - Needs `__` import and string wrapping + - `Developer.tsx` - Needs `__` import and string wrapping + +**Action Required:** +Add translation support to these 3 files (can be done during next iteration) + +--- + +## โœ… Task 2: Documentation Audit + +### Status: COMPLETED โœ“ + +**Actions Taken:** +1. โœ… Created `DOCS_AUDIT_REPORT.md` - Comprehensive audit of all 36 MD files +2. โœ… Deleted 12 obsolete documents: + - CUSTOMER_SETTINGS_404_FIX.md + - MENU_FIX_SUMMARY.md + - DASHBOARD_TWEAKS_TODO.md + - DASHBOARD_PLAN.md + - SPA_ADMIN_MENU_PLAN.md + - STANDALONE_ADMIN_SETUP.md + - STANDALONE_MODE_SUMMARY.md + - SETTINGS_PAGES_PLAN.md + - SETTINGS_PAGES_PLAN_V2.md + - SETTINGS_TREE_PLAN.md + - SETTINGS_PLACEMENT_STRATEGY.md + - TAX_NOTIFICATIONS_PLAN.md + +**Result:** +- Reduced from 36 to 24 documents (33% reduction) +- Clearer focus on active development +- Easier navigation for developers + +**Remaining Documents:** +- 15 essential docs (keep as-is) +- 9 docs to consolidate later (low priority) + +--- + +## ๐Ÿšง Task 3: Notification Settings Implementation + +### Status: IN PROGRESS + +**Plan:** Follow NOTIFICATION_STRATEGY.md + +### Phase 1: Core Framework (Current) +1. **Backend (PHP)** + - [ ] Create `NotificationManager` class + - [ ] Create `EmailChannel` class (built-in) + - [ ] Create notification events registry + - [ ] Create REST API endpoints + - [ ] Add hooks for addon integration + +2. **Frontend (React)** + - [ ] Update `Notifications.tsx` settings page + - [ ] Create channel cards UI + - [ ] Create event configuration UI + - [ ] Add channel toggle/enable functionality + - [ ] Add template editor (email) + +3. **Database** + - [ ] Notification events table (optional) + - [ ] Use wp_options for settings + - [ ] Channel configurations + +### Implementation Steps + +#### Step 1: Backend Core +``` +includes/Core/Notifications/ +โ”œโ”€โ”€ NotificationManager.php # Main manager +โ”œโ”€โ”€ NotificationEvent.php # Event class +โ”œโ”€โ”€ Channels/ +โ”‚ โ””โ”€โ”€ EmailChannel.php # Built-in email +โ””โ”€โ”€ NotificationSettingsProvider.php # Settings CRUD +``` + +#### Step 2: REST API +``` +includes/Api/NotificationsController.php +- GET /notifications/channels # List available channels +- GET /notifications/events # List notification events +- GET /notifications/settings # Get all settings +- POST /notifications/settings # Save settings +``` + +#### Step 3: Frontend UI +``` +admin-spa/src/routes/Settings/Notifications.tsx +- Channel cards (email + addon channels) +- Event configuration per category +- Toggle channels per event +- Recipient selection (admin/customer/both) +``` + +### Key Features +- โœ… Email channel built-in +- โœ… Addon integration via hooks +- โœ… Per-event channel selection +- โœ… Recipient targeting +- โœ… Template system ready + +--- + +## Next Actions + +### Immediate +1. โœ… Commit documentation cleanup +2. ๐Ÿšง Start notification system implementation +3. โณ Add translation to Store/Payments/Developer pages + +### This Session +- Implement notification core framework +- Create REST API endpoints +- Build basic UI for notification settings + +### Future +- Build Telegram addon as proof of concept +- Create addon development template +- Document notification addon API diff --git a/TAX_NOTIFICATIONS_PLAN.md b/TAX_NOTIFICATIONS_PLAN.md deleted file mode 100644 index 5c880ff..0000000 --- a/TAX_NOTIFICATIONS_PLAN.md +++ /dev/null @@ -1,106 +0,0 @@ -# Tax & Notifications Implementation Plan - -## Philosophy: 80/20 Rule - Real Value, Not Menu-ing - -WooNooW provides elegant UX for 80% of daily use cases. -The 20% advanced/rare features stay in WooCommerce. - ---- - -## Tax Settings - What to Build - -### Core Features (80% use cases): - -1. **Enable/Disable Tax Calculation** - - Simple toggle - - Clear explanation - -2. **Tax Rates by Country/State** - - Add/Edit/Delete tax rates - - Country selector - - State selector (for countries with states) - - Rate percentage input - - Tax class selector (Standard, Reduced, Zero) - -3. **Prices Include Tax Toggle** - - "Prices entered with tax" vs "without tax" - - Clear explanation - -4. **Display Settings** - - Show prices in shop: including/excluding tax - - Show prices in cart: including/excluding tax - - Display suffix (e.g., "incl. VAT") - -### Advanced Features (Link to WooCommerce): - -- Complex tax classes (rare) -- Compound taxes (rare) -- Tax based on shipping vs billing (advanced) -- Custom tax tables (very rare) - ---- - -## Notifications Settings - What to Build - -### Core Features (80% use cases): - -1. **Email Enable/Disable** - - Toggle for each email type - - Already implemented โœ… - -2. **Edit Email Subjects** - - Inline editing of subject lines - - Variables support ({order_number}, {site_title}) - -3. **Sender Configuration** - - "From" name - - "From" email address - -4. **Email Preview** - - Preview button for each email - - Opens WooCommerce preview - -### Advanced Features (Link to WooCommerce): - -- Full HTML template editing (advanced) -- Custom email templates (developer) -- Header/footer customization (advanced) -- Additional recipients (rare) - ---- - -## Implementation Priority - -### Phase 1: Tax Rates (High Impact) -1. Backend: Tax rates CRUD API -2. Frontend: Tax rates list + Add/Edit dialog -3. Frontend: Enable/disable toggle -4. Frontend: Prices include tax toggle - -### Phase 2: Email Subjects (High Impact) -1. Backend: Get/update email settings API -2. Frontend: Sender name/email inputs -3. Frontend: Inline subject editing -4. Frontend: Preview links - -### Phase 3: Tax Display Settings (Medium Impact) -1. Frontend: Display settings card -2. Backend: Save display preferences - ---- - -## API Endpoints Needed - -### Tax: -- GET /settings/tax/rates -- POST /settings/tax/rates -- PUT /settings/tax/rates/{id} -- DELETE /settings/tax/rates/{id} -- GET /settings/tax/config -- POST /settings/tax/config - -### Notifications: -- GET /settings/notifications/emails -- POST /settings/notifications/emails/{id} -- GET /settings/notifications/sender -- POST /settings/notifications/sender diff --git a/admin-spa/src/App.tsx b/admin-spa/src/App.tsx index d2d0e98..586b02b 100644 --- a/admin-spa/src/App.tsx +++ b/admin-spa/src/App.tsx @@ -522,6 +522,9 @@ function Shell() { // Check if current route is More page (no submenu needed) const isMorePage = location.pathname === '/more'; + const submenuTopClass = fullscreen ? 'top-0' : 'top-[calc(7rem+32px)]'; + const submenuZIndex = fullscreen ? 'z-50' : 'z-40'; + return ( {!isStandalone && } @@ -550,7 +553,7 @@ function Shell() { ) : (
{/* Flex wrapper: mobile = col (PageHeader first), desktop = col-reverse (SubmenuBar first) */} -
+
{!isMorePage && (isDashboardRoute ? ( @@ -571,7 +574,7 @@ function Shell() {
{/* Flex wrapper: mobile = col (PageHeader first), desktop = col-reverse (SubmenuBar first) */} -
+
{isDashboardRoute ? ( diff --git a/admin-spa/src/components/nav/SubmenuBar.tsx b/admin-spa/src/components/nav/SubmenuBar.tsx index 174a403..afbe4be 100644 --- a/admin-spa/src/components/nav/SubmenuBar.tsx +++ b/admin-spa/src/components/nav/SubmenuBar.tsx @@ -17,7 +17,7 @@ export default function SubmenuBar({ items = [], fullscreen = false, headerVisib const topClass = fullscreen ? 'top-0' : 'top-[calc(7rem+32px)]'; return ( -
+
{items.map((it) => { diff --git a/admin-spa/src/components/ui/image-upload.tsx b/admin-spa/src/components/ui/image-upload.tsx index 3ec9bd3..ae1e7fb 100644 --- a/admin-spa/src/components/ui/image-upload.tsx +++ b/admin-spa/src/components/ui/image-upload.tsx @@ -118,7 +118,7 @@ export function ImageUpload({ }; return ( -
+
{label && (