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
This commit is contained in:
@@ -29,31 +29,12 @@ class WishlistSettings {
|
||||
'description' => __('Allow non-logged-in users to create wishlists (stored in browser)', 'woonoow'),
|
||||
'default' => true,
|
||||
],
|
||||
'wishlist_page' => [
|
||||
'type' => 'select',
|
||||
'label' => __('Wishlist Page', 'woonoow'),
|
||||
'description' => __('Page to display wishlist items', 'woonoow'),
|
||||
'placeholder' => __('-- Select Page --', 'woonoow'),
|
||||
'options' => self::get_pages_options(),
|
||||
],
|
||||
'show_in_header' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Show Wishlist Icon in Header', 'woonoow'),
|
||||
'description' => __('Display wishlist icon with item count in the header', 'woonoow'),
|
||||
'default' => true,
|
||||
],
|
||||
'enable_sharing' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Enable Wishlist Sharing', 'woonoow'),
|
||||
'description' => __('Allow users to share their wishlists via link', 'woonoow'),
|
||||
'default' => true,
|
||||
],
|
||||
'enable_email_notifications' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Back in Stock Notifications', 'woonoow'),
|
||||
'description' => __('Email users when wishlist items are back in stock', 'woonoow'),
|
||||
'default' => false,
|
||||
],
|
||||
'max_items_per_wishlist' => [
|
||||
'type' => 'number',
|
||||
'label' => __('Maximum Items Per Wishlist', 'woonoow'),
|
||||
@@ -62,34 +43,37 @@ class WishlistSettings {
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
],
|
||||
'enable_multiple_wishlists' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Enable Multiple Wishlists', 'woonoow'),
|
||||
'description' => __('Allow users to create multiple named wishlists', 'woonoow'),
|
||||
'default' => false,
|
||||
],
|
||||
'show_add_to_cart_button' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Show "Add to Cart" on Wishlist Page', 'woonoow'),
|
||||
'description' => __('Display add to cart button for each wishlist item', 'woonoow'),
|
||||
'default' => true,
|
||||
],
|
||||
// Advanced features - Coming Soon
|
||||
'enable_sharing' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Enable Wishlist Sharing (Coming Soon)', 'woonoow'),
|
||||
'description' => __('Allow users to share their wishlists via link - Feature not yet implemented', 'woonoow'),
|
||||
'default' => false,
|
||||
'disabled' => true,
|
||||
],
|
||||
'enable_email_notifications' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Back in Stock Notifications (Coming Soon)', 'woonoow'),
|
||||
'description' => __('Email users when wishlist items are back in stock - Feature not yet implemented', 'woonoow'),
|
||||
'default' => false,
|
||||
'disabled' => true,
|
||||
],
|
||||
'enable_multiple_wishlists' => [
|
||||
'type' => 'toggle',
|
||||
'label' => __('Enable Multiple Wishlists (Coming Soon)', 'woonoow'),
|
||||
'description' => __('Allow users to create multiple named wishlists - Feature not yet implemented', 'woonoow'),
|
||||
'default' => false,
|
||||
'disabled' => true,
|
||||
],
|
||||
];
|
||||
|
||||
return $schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get WordPress pages as select options
|
||||
*/
|
||||
private static function get_pages_options() {
|
||||
$pages = get_pages();
|
||||
$options = [];
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$options[$page->ID] = $page->post_title;
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user