diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 9b031d3..9a142d2 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -39,9 +39,9 @@ $routes->get('/login', 'AuthController::login'); $routes->post('/signup', 'AuthController::signup/local'); $routes->get('/signup/(:alpha)', 'AuthController::signup/$1'); $routes->get('/logout', 'AuthController::logout'); -$routes->group('cart', ['namespace' => 'App\Controllers'], static function ($routes) { - $routes->post('addCart', 'CartController::addCart'); - $routes->get('cancelCart/(:uuid)', 'CartController::cancelCart/$1'); +$routes->group('ecommerce', ['namespace' => 'App\Controllers'], static function ($routes) { + $routes->post('addCart', 'EcommerceController::addCart'); + $routes->get('cancelCart/(:uuid)', 'EcommerceController::cancelCart/$1'); });; $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) { }); diff --git a/app/Config/Routes_Shoppinmall.php b/app/Config/Routes_Shoppinmall.php index 0a39373..9a142d2 100644 --- a/app/Config/Routes_Shoppinmall.php +++ b/app/Config/Routes_Shoppinmall.php @@ -39,9 +39,9 @@ $routes->get('/login', 'AuthController::login'); $routes->post('/signup', 'AuthController::signup/local'); $routes->get('/signup/(:alpha)', 'AuthController::signup/$1'); $routes->get('/logout', 'AuthController::logout'); -$routes->group('cart', ['namespace' => 'App\Controllers'], static function ($routes) { - $routes->post('addCart', 'CartController::addCart'); - $routes->get('cancelCart/(:uuid)', 'CartController::cancelCart/$1'); +$routes->group('ecommerce', ['namespace' => 'App\Controllers'], static function ($routes) { + $routes->post('addCart', 'EcommerceController::addCart'); + $routes->get('cancelCart/(:uuid)', 'EcommerceController::cancelCart/$1'); });; $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) { }); @@ -124,8 +124,9 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->group('order', static function ($routes) { $routes->get('', 'OrderController::index'); $routes->get('view/(:uuid)', 'OrderController::view/$1'); - $routes->post('batchjob', 'OrderController::batchjob`'); $routes->get('delete/(:uuid)', 'OrderController::delete/$1', ['filter' => 'authFilter:master']); + $routes->get('toggle/(:uuid)/(:hash)', 'OrderController::toggle/$1/$2'); + $routes->post('batchjob', 'OrderController::batchjob`'); }); }); $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) { diff --git a/app/Controllers/CartController.php b/app/Controllers/EcommerceController.php similarity index 99% rename from app/Controllers/CartController.php rename to app/Controllers/EcommerceController.php index 4ff4c27..7c83020 100644 --- a/app/Controllers/CartController.php +++ b/app/Controllers/EcommerceController.php @@ -11,7 +11,7 @@ use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -class CartController extends Controller +class EcommerceController extends Controller { /** * Instance of the main Request object. diff --git a/app/Views/admin/order/index.php b/app/Views/admin/order/index.php index 879a362..020703d 100644 --- a/app/Views/admin/order/index.php +++ b/app/Views/admin/order/index.php @@ -27,7 +27,7 @@ - getStatus() == DEFAULTS['STATUS'] ? anchor('cart/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?> + getStatus() == DEFAULTS['STATUS'] ? anchor('ecommerce/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?> diff --git a/app/Views/front/order/index.php b/app/Views/front/order/index.php index d9c12d4..a4e8582 100644 --- a/app/Views/front/order/index.php +++ b/app/Views/front/order/index.php @@ -25,7 +25,7 @@ - getStatus() == DEFAULTS['STATUS'] ? anchor('cart/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?> + getStatus() == DEFAULTS['STATUS'] ? anchor('ecommerce/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?> diff --git a/app/Views/front/product/addCart.php b/app/Views/front/product/addCart.php index 0ad13d5..33fc04e 100644 --- a/app/Views/front/product/addCart.php +++ b/app/Views/front/product/addCart.php @@ -1,4 +1,4 @@ - 'post']) ?> + 'post']) ?> getPrimaryKey()) ?>