vendor/crehler/mojebambino-engine/src/Storefront/Controller/FilterController.php line 35

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Crehler\MojeBambinoEngine\Storefront\Controller;
  3. use Crehler\MojeBambinoEngine\Service\FilterService;
  4. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  5. use Shopware\Core\Framework\Routing\Exception\MissingRequestParameterException;
  6. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  7. use Shopware\Storefront\Controller\StorefrontController;
  8. use Shopware\Storefront\Framework\Cache\Annotation\HttpCache;
  9. use Symfony\Component\HttpFoundation\JsonResponse;
  10. use Symfony\Component\HttpFoundation\Request;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. /**
  13.  * @RouteScope(scopes={"storefront"})
  14.  */
  15. class FilterController extends StorefrontController
  16. {
  17.     private FilterService $filterService;
  18.     public function __construct(
  19.         FilterService $filterService
  20.     ) {
  21.         $this->filterService $filterService;
  22.     }
  23.     /**
  24.      * @HttpCache()
  25.      *
  26.      * @Route("/widgets/cms/navigation/{navigationId}/countResult", name="frontend.cms.navigation.page.countResult", methods={"GET", "POST"}, defaults={"navigationId"=null, "XmlHttpRequest"=true})
  27.      *
  28.      * @throws MissingRequestParameterException
  29.      */
  30.     public function countResult(string $navigationIdRequest $requestSalesChannelContext $salesChannelContext): JsonResponse
  31.     {
  32.         if (!$navigationId) {
  33.             throw new MissingRequestParameterException('Parameter navigationId missing');
  34.         }
  35. //        $filterProductCounter = $this->filterService->getCountProductsByFilter($navigationId, $request, $salesChannelContext);
  36.         $filterProductCounter = [];
  37.         return new JsonResponse($filterProductCounter);
  38.     }
  39. }