Files
WooNooW/includes/Api
dwindown f75f4c6e33 fix: Resolve route conflict - OrdersController was hijacking /products endpoint
ROOT CAUSE FOUND!

OrdersController registered /products BEFORE ProductsController:
- OrdersController::init() called first (line 25 in Routes.php)
- ProductsController::register_routes() called later (line 95)
- WordPress uses FIRST matching route
- OrdersController /products was winning!

This explains EVERYTHING:
 Route registered: SUCCESS
 Callback is_callable: YES
 Permissions: ALLOWED
 Request goes to /woonoow/v1/products
 But OrdersController::products() was handling it!

Solution:
1. Changed OrdersController route from /products to /products/search
2. Updated ProductsApi.search() to use /products/search
3. Now /products is free for ProductsController!

Result:
- /products → ProductsController::get_products() (full product list)
- /products/search → OrdersController::products() (lightweight search for orders)

This will finally make ProductsController work!
2025-11-20 00:58:48 +07:00
..