Commit Graph

2 Commits

Author SHA1 Message Date
Dwindi Ramadhana
4095d2a70c feat: Wishlist settings cleanup + Categories/Tags/Attributes CRUD pages
Wishlist Settings Cleanup:
- Removed wishlist_page setting (not needed for SPA architecture)
- Marked advanced features as 'Coming Soon' with disabled flag:
  * Wishlist Sharing
  * Back in Stock Notifications
  * Multiple Wishlists
- Added disabled prop support to SchemaField toggle component
- Kept only working features: guest wishlist, show in header, max items, add to cart button

Product Taxonomy CRUD Pages:
Built full CRUD interfaces for all three taxonomy types:

1. Categories (/products/categories):
   - Table view with search
   - Create/Edit dialog with name, slug, description
   - Delete with confirmation
   - Product count display
   - Parent category support

2. Tags (/products/tags):
   - Table view with search
   - Create/Edit dialog with name, slug, description
   - Delete with confirmation
   - Product count display

3. Attributes (/products/attributes):
   - Table view with search
   - Create/Edit dialog with label, slug, type, orderby
   - Delete with confirmation
   - Type selector (Select/Text)
   - Sort order selector (Custom/Name/ID)

All pages include:
- React Query for data fetching/mutations
- Toast notifications for success/error
- Loading states
- Empty states
- Responsive tables
- Dialog forms with validation

Files Modified:
- includes/Modules/WishlistSettings.php (removed page selector, marked advanced as coming soon)
- admin-spa/src/components/forms/SchemaField.tsx (added disabled prop)
- admin-spa/src/routes/Products/Categories.tsx (full CRUD)
- admin-spa/src/routes/Products/Tags.tsx (full CRUD)
- admin-spa/src/routes/Products/Attributes.tsx (full CRUD)
- admin-spa/src/components/nav/SubmenuBar.tsx (removed debug logging)
- admin-spa/dist/app.js (rebuilt)

Result:
 Wishlist settings now clearly show what's implemented vs coming soon
 Categories/Tags/Attributes pages fully functional
 Professional CRUD interfaces matching admin design
 All taxonomy management now in SPA
2025-12-26 23:43:40 +07:00
Dwindi Ramadhana
daebd5f989 fix: Newsletter React error #310 and refactor Wishlist module
Newsletter Fix:
- Move all hooks (useQuery, useMutation) before conditional returns
- Add 'enabled' option to useQuery to control when it fetches
- Fixes React error #310: useEffect called conditionally
- Newsletter page now loads without errors at /marketing/newsletter

Wishlist Module Refactoring:
- Create WishlistSettings.php with 8 configurable settings:
  * Enable guest wishlists
  * Wishlist page selector
  * Show in header toggle
  * Enable sharing
  * Back in stock notifications
  * Max items per wishlist
  * Multiple wishlists support
  * Show add to cart button
- Add has_settings flag to wishlist module in ModuleRegistry
- Initialize WishlistSettings in woonoow.php
- Update customer-spa BaseLayout to use isEnabled('wishlist') check
- Wishlist page already has module check (no changes needed)

Files Added (1):
- includes/Modules/WishlistSettings.php

Files Modified (5):
- admin-spa/src/routes/Marketing/Newsletter.tsx
- includes/Core/ModuleRegistry.php
- woonoow.php
- customer-spa/src/layouts/BaseLayout.tsx
- admin-spa/dist/app.js (rebuilt)

Both newsletter and wishlist now follow the same module pattern:
- Settings via schema (no code required)
- Module enable/disable controls feature visibility
- Settings page at /settings/modules/{module_id}
- Consistent user experience
2025-12-26 21:29:27 +07:00