src/Flexy/FrontBundle/Themes/IlaveU/Controller/CartController.php line 18

  1. <?php
  2. namespace App\Flexy\FrontBundle\Themes\IlaveU\Controller;
  3. use App\Flexy\ProductBundle\Repository\ProductRepository;
  4. use App\Flexy\ShopBundle\Entity\Product\ProductShop;
  5. use App\Flexy\ShopBundle\Repository\Customer\CustomerRepository;
  6. use App\Flexy\ShopBundle\Repository\Shipping\CityRegionRepository;
  7. use App\Flexy\ShopBundle\Repository\Shipping\ShippingMethodRepository;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. use Symfony\Component\HttpFoundation\Response;
  10. use Symfony\Component\Routing\Annotation\Route;
  11. #[Route('/{_locale}/shop/cart')]
  12. class CartController extends AbstractController
  13. {
  14.     #[Route('/'name'cart')]
  15.     public function cart(ShippingMethodRepository $shippingMethodRepository,CustomerRepository $customerRepository,CityRegionRepository $cityRegionRepository): Response
  16.     {
  17.         $shippingMethods $shippingMethodRepository->findAll();
  18.         $cityRegions $cityRegionRepository->findAll();
  19.         $customer null;
  20.         if($this->getUser()){
  21.             $customer $customerRepository->findOneBy(["user"=>$this->getUser()]);
  22.         }
  23.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig',
  24.     [
  25.         "shippingMethods"=>$shippingMethods,
  26.         "customer"=>$customer,
  27.         "totalCart"=>160,
  28.         "cityRegions"=>$cityRegions
  29.     ]);
  30.     }
  31.     #[Route('/wishlist'name'wishlist')]
  32.     public function wishlist(): Response
  33.     {
  34.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/cart/wishlist.html.twig');
  35.     }
  36.     #[Route('/compare'name'compare')]
  37.     public function compare(): Response
  38.     {
  39.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/cart/compare.html.twig');
  40.     }
  41.     #[Route('/show-devis'name'show_devis')]
  42.     public function show_devis(): Response
  43.     {
  44.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/cart/showDevis.html.twig');
  45.     }
  46. }