## Brand Settings Implementation ✅ ### Backend: 1. **StoreSettingsProvider** - Added branding fields - store_logo - store_icon - store_tagline - primary_color - accent_color - error_color 2. **Branding Class** - Complete branding system - ✅ Logo display (image or text fallback "WooNooW") - ✅ Favicon injection (wp_head, admin_head, login_head) - ✅ Brand colors as CSS variables - ✅ Login page customization - Logo or text - Tagline - Primary color for buttons/links - ✅ Login logo URL → home_url() - ✅ Login logo title → store name ### Features: - **Logo fallback:** No logo → Shows "WooNooW" text - **Login page:** Fully branded with logo, tagline, colors - **Favicon:** Applied to frontend, admin, login - **Colors:** Injected as CSS variables (--woonoow-primary, --accent, --error) --- ## Developer Settings Page ✅ ### Frontend: Created `/settings/developer` page with: 1. **Debug Mode Section** - Enable Debug Mode toggle - Show API Logs (when debug enabled) - Enable React DevTools (when debug enabled) 2. **System Information Section** - WooNooW Version - WooCommerce Version - WordPress Version - PHP Version - HPOS Enabled status 3. **Cache Management Section** - Clear Navigation Cache - Clear Settings Cache - Clear All Caches (destructive) - Loading states with spinner ### Backend: 1. **DeveloperController** - Settings API - GET /woonoow/v1/settings/developer - POST /woonoow/v1/settings/developer - Stores: debug_mode, show_api_logs, enable_react_devtools 2. **SystemController** - System info & cache - GET /woonoow/v1/system/info - POST /woonoow/v1/cache/clear - Cache types: navigation, settings, all --- ## Settings Structure (Final) ``` Settings (6 tabs) ├── Store Details ✅ │ ├── Store Overview │ ├── Store Identity │ ├── Brand (logo, icon, colors) │ ├── Store Address │ ├── Currency & Formatting │ └── Standards & Formats ├── Payments ✅ ├── Shipping & Delivery ✅ ├── Tax ✅ ├── Notifications ✅ └── Developer ✅ (NEW) ├── Debug Mode ├── System Information └── Cache Management ``` --- ## Implementation Details ### Branding System: ```php // Logo fallback logic if (logo exists) → Show image else → Show "WooNooW" text // Login page - Logo or text - Tagline below logo - Primary color for buttons/links - Input focus color ``` ### Developer Settings: ```typescript // API logging localStorage.setItem('woonoow_api_logs', 'true'); // React DevTools localStorage.setItem('woonoow_react_devtools', 'true'); // Cache clearing POST /cache/clear { type: 'navigation' | 'settings' | 'all' } ``` --- ## Result ✅ Brand settings fully functional ✅ Logo displays on login page (or text fallback) ✅ Favicon applied everywhere ✅ Brand colors injected as CSS variables ✅ Developer page complete ✅ System info displayed ✅ Cache management working ✅ All 6 settings tabs implemented **Ready to test in browser!**
85 lines
3.0 KiB
PHP
85 lines
3.0 KiB
PHP
<?php
|
|
namespace WooNooW\Api;
|
|
|
|
use WP_REST_Request;
|
|
use WP_REST_Response;
|
|
use WooNooW\Api\CheckoutController;
|
|
use WooNooW\Api\OrdersController;
|
|
use WooNooW\Api\AnalyticsController;
|
|
use WooNooW\Api\AuthController;
|
|
use WooNooW\API\PaymentsController;
|
|
use WooNooW\API\StoreController;
|
|
use WooNooW\Api\ShippingController;
|
|
use WooNooW\Api\TaxController;
|
|
use WooNooW\Api\PickupLocationsController;
|
|
use WooNooW\Api\EmailController;
|
|
use WooNooW\API\DeveloperController;
|
|
use WooNooW\API\SystemController;
|
|
|
|
class Routes {
|
|
public static function init() {
|
|
// Initialize controllers (register action hooks)
|
|
OrdersController::init();
|
|
|
|
add_action('rest_api_init', function () {
|
|
$namespace = 'woonoow/v1';
|
|
|
|
// Auth endpoints (public - no permission check)
|
|
register_rest_route( $namespace, '/auth/login', [
|
|
'methods' => 'POST',
|
|
'callback' => [ AuthController::class, 'login' ],
|
|
'permission_callback' => '__return_true',
|
|
] );
|
|
|
|
register_rest_route( $namespace, '/auth/logout', [
|
|
'methods' => 'POST',
|
|
'callback' => [ AuthController::class, 'logout' ],
|
|
'permission_callback' => '__return_true',
|
|
] );
|
|
|
|
register_rest_route( $namespace, '/auth/check', [
|
|
'methods' => 'GET',
|
|
'callback' => [ AuthController::class, 'check' ],
|
|
'permission_callback' => '__return_true',
|
|
] );
|
|
|
|
// Defer to controllers to register their endpoints
|
|
CheckoutController::register();
|
|
OrdersController::register();
|
|
AnalyticsController::register_routes();
|
|
|
|
// Payments controller
|
|
$payments_controller = new PaymentsController();
|
|
$payments_controller->register_routes();
|
|
|
|
// Store controller
|
|
$store_controller = new StoreController();
|
|
$store_controller->register_routes();
|
|
|
|
// Shipping controller
|
|
$shipping_controller = new ShippingController();
|
|
$shipping_controller->register_routes();
|
|
|
|
// Tax controller
|
|
$tax_controller = new TaxController();
|
|
$tax_controller->register_routes();
|
|
|
|
// Pickup locations controller
|
|
$pickup_controller = new PickupLocationsController();
|
|
$pickup_controller->register_routes();
|
|
|
|
// Email controller
|
|
$email_controller = new EmailController();
|
|
$email_controller->register_routes();
|
|
|
|
// Developer controller
|
|
$developer_controller = new DeveloperController();
|
|
$developer_controller->register_routes();
|
|
|
|
// System controller
|
|
$system_controller = new SystemController();
|
|
$system_controller->register_routes();
|
|
});
|
|
}
|
|
}
|