PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.21
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.21
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Modules / Shipping / Http / shipping-api.php

shipping-api.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.21, at app/Modules/Shipping/Http/shipping-api.php

38 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <?php
3 /**
4 * @var $router Router
5 */
6 use FluentCart\App\Modules\Shipping\Http\Controllers\ShippingZoneController;
7 use FluentCart\App\Modules\Shipping\Http\Controllers\ShippingClassController;
8 use FluentCart\App\Modules\Shipping\Http\Controllers\ShippingMethodController;
9 use FluentCart\Framework\Http\Router;
10
11 $router->prefix('shipping')->withPolicy('StoreSensitivePolicy')->group(function (Router $router) {
12 $router->get('/zones', [ShippingZoneController::class, 'index']);
13 $router->post('/zones', [ShippingZoneController::class, 'store']);
14 $router->get('/zones/{id}', [ShippingZoneController::class, 'show']);
15 $router->put('/zones/{id}', [ShippingZoneController::class, 'update']);
16 $router->delete('/zones/{id}', [ShippingZoneController::class, 'destroy']);
17 $router->post('/zones/update-order', [ShippingZoneController::class, 'updateOrder']);
18
19 $router->get('/zone/states', [ShippingZoneController::class, 'getZoneStates']);
20
21 // Methods
22 $router->post('/methods', [ShippingMethodController::class, 'store']);
23 $router->put('/methods', [ShippingMethodController::class, 'update']);
24 $router->delete('/methods/{method_id}', [ShippingMethodController::class, 'destroy']);
25
26 // Shipping Classes
27 $router->get('/classes', [ShippingClassController::class, 'index']);
28 $router->post('/classes', [ShippingClassController::class, 'store']);
29 $router->get('/classes/{id}', [ShippingClassController::class, 'show']);
30 $router->put('/classes/{id}', [ShippingClassController::class, 'update']);
31 $router->delete('/classes/{id}', [ShippingClassController::class, 'destroy']);
32 $router->get('/classes/{id}/profile', [ShippingClassController::class, 'getProfile']);
33
34 // Packages (stored in fct_meta, not a DB table)
35 $router->get('/packages', [ShippingClassController::class, 'getPackages']);
36 $router->post('/packages', [ShippingClassController::class, 'savePackages']);
37 });
38