PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
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 trunk 1.2.0 All 47 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.6.4, at app/Modules/Shipping/Http/shipping-api.php

39 lines 2.0 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 $router->get('/zone/countries', [ShippingZoneController::class, 'getCountriesByContinent']);
21
22 // Methods
23 $router->post('/methods', [ShippingMethodController::class, 'store']);
24 $router->put('/methods', [ShippingMethodController::class, 'update']);
25 $router->delete('/methods/{method_id}', [ShippingMethodController::class, 'destroy']);
26
27 // Shipping Classes
28 $router->get('/classes', [ShippingClassController::class, 'index']);
29 $router->post('/classes', [ShippingClassController::class, 'store']);
30 $router->get('/classes/{id}', [ShippingClassController::class, 'show']);
31 $router->put('/classes/{id}', [ShippingClassController::class, 'update']);
32 $router->delete('/classes/{id}', [ShippingClassController::class, 'destroy']);
33 $router->get('/classes/{id}/profile', [ShippingClassController::class, 'getProfile']);
34
35 // Packages (stored in fct_meta, not a DB table)
36 $router->get('/packages', [ShippingClassController::class, 'getPackages']);
37 $router->post('/packages', [ShippingClassController::class, 'savePackages']);
38 });
39