2025-10-11 18:31:07 -07:00
|
|
|
<?php
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace CakeCarts\Controller;
|
|
|
|
|
|
|
|
|
|
use App\Controller\AppController;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Carts Controller
|
|
|
|
|
*
|
|
|
|
|
* @property \Authorization\Controller\Component\AuthorizationComponent $Authorization
|
|
|
|
|
*/
|
2026-01-23 20:32:22 -08:00
|
|
|
class CartsController extends AppController {
|
2025-10-11 18:31:07 -07:00
|
|
|
|
2026-01-23 20:32:22 -08:00
|
|
|
/**
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function initialize(): void {
|
|
|
|
|
parent::initialize(); // TODO: Change the autogenerated stub
|
2025-10-11 18:31:07 -07:00
|
|
|
|
2026-01-23 20:32:22 -08:00
|
|
|
if (!$this->components()->has('ShoppingCart')) {
|
|
|
|
|
$this->loadComponent('CakeCarts.ShoppingCart', [
|
|
|
|
|
// This is default config. You can modify "actions" as needed to make
|
|
|
|
|
// component work only for specified methods.
|
|
|
|
|
'actions' => true,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-10-11 18:31:07 -07:00
|
|
|
* Index method
|
|
|
|
|
*
|
|
|
|
|
* @return \Cake\Http\Response|null|void Renders view
|
|
|
|
|
*/
|
2026-01-23 20:32:22 -08:00
|
|
|
public function index() {
|
|
|
|
|
// use cart from beforeFilter
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-11 18:31:07 -07:00
|
|
|
}
|