custom/static-plugins/SamsonCustomer/src/Controller/AccountOrderController.php line 83

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Samson\Controller;
  3. /***
  4.  *
  5.  * This file is part of the "SAMSON Shop" project.
  6.  *
  7.  * For the full copyright and license information, please read the
  8.  * LICENSE.txt file that was distributed with this source code.
  9.  *
  10.  *  (c) 2024
  11.  *
  12.  ***/
  13. use Samson\Exception\CustomerNeedsPasswordChangeException;
  14. use Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException;
  15. use Shopware\Core\Checkout\Order\SalesChannel\AbstractCancelOrderRoute;
  16. use Shopware\Core\Checkout\Order\SalesChannel\AbstractOrderRoute;
  17. use Shopware\Core\Checkout\Order\SalesChannel\AbstractSetPaymentOrderRoute;
  18. use Shopware\Core\Checkout\Order\SalesChannel\OrderService;
  19. use Shopware\Core\Checkout\Payment\SalesChannel\AbstractHandlePaymentMethodRoute;
  20. use Shopware\Core\System\SalesChannel\Context\SalesChannelContextServiceInterface;
  21. use Shopware\Core\System\SalesChannel\SalesChannel\AbstractContextSwitchRoute;
  22. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  23. use Shopware\Core\System\SystemConfig\SystemConfigService;
  24. use Shopware\Storefront\Controller\AccountOrderController as ShopwareAccountOrderController;
  25. use Shopware\Storefront\Page\Account\Order\AccountEditOrderPageLoader;
  26. use Shopware\Storefront\Page\Account\Order\AccountOrderDetailPageLoader;
  27. use Shopware\Storefront\Page\Account\Order\AccountOrderPageLoader;
  28. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  29. use Symfony\Component\HttpFoundation\Request;
  30. use Symfony\Component\HttpFoundation\Response;
  31. use Samson\Annotation\CustomerNeedsPasswordChange;
  32. use Shopware\Core\Framework\Routing\Annotation\LoginRequired;
  33. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  34. use Shopware\Core\Framework\Routing\Annotation\Since;
  35. use Shopware\Storefront\Framework\Routing\Annotation\NoStore;
  36. use Symfony\Component\Routing\Annotation\Route;
  37. /**
  38.  * @RouteScope(scopes={"storefront"})
  39.  */
  40. class AccountOrderController extends ShopwareAccountOrderController
  41. {
  42.     public function __construct(AccountOrderPageLoader              $orderPageLoader,
  43.                                 AccountEditOrderPageLoader          $accountEditOrderPageLoader,
  44.                                 AbstractContextSwitchRoute          $contextSwitchRoute,
  45.                                 AbstractCancelOrderRoute            $cancelOrderRoute,
  46.                                 AbstractSetPaymentOrderRoute        $setPaymentOrderRoute,
  47.                                 AbstractHandlePaymentMethodRoute    $handlePaymentMethodRoute,
  48.                                 EventDispatcherInterface            $eventDispatcher,
  49.                                 AccountOrderDetailPageLoader        $orderDetailPageLoader,
  50.                                 AbstractOrderRoute                  $orderRoute,
  51.                                 SalesChannelContextServiceInterface $contextService,
  52.                                 SystemConfigService                 $systemConfigService,
  53.                                 OrderService                        $orderService)
  54.     {
  55.         parent::__construct($orderPageLoader,
  56.             $accountEditOrderPageLoader,
  57.             $contextSwitchRoute,
  58.             $cancelOrderRoute,
  59.             $setPaymentOrderRoute,
  60.             $handlePaymentMethodRoute,
  61.             $eventDispatcher,
  62.             $orderDetailPageLoader,
  63.             $orderRoute,
  64.             $contextService,
  65.             $systemConfigService,
  66.             $orderService);
  67.     }
  68.     /**
  69.      * @Since("6.0.0.0")
  70.      * @LoginRequired(allowGuest=true)
  71.      * @CustomerNeedsPasswordChange()
  72.      * @Route("/account/order", name="frontend.account.order.page", options={"seo"="false"}, methods={"GET", "POST"}, defaults={"XmlHttpRequest"=true})
  73.      * @NoStore
  74.      *
  75.      * @throws CustomerNotLoggedInException
  76.      * @throws CustomerNeedsPasswordChangeException
  77.      */
  78.     public function orderOverview(Request $requestSalesChannelContext $context): Response
  79.     {
  80.         return parent::orderOverview($request$context);
  81.     }
  82.     /**
  83.      * @Since("6.2.0.0")
  84.      * @CustomerNeedsPasswordChange()
  85.      * @Route("/account/order/{deepLinkCode}", name="frontend.account.order.single.page", options={"seo"="false"}, methods={"GET", "POST"})
  86.      * @NoStore
  87.      *
  88.      * @throws CustomerNotLoggedInException
  89.      * @throws CustomerNeedsPasswordChangeException
  90.      */
  91.     public function orderSingleOverview(Request $requestSalesChannelContext $context): Response
  92.     {
  93.         return parent::orderSingleOverview($request$context);
  94.     }
  95.     /**
  96.      * @Since("6.0.0.0")
  97.      * @LoginRequired()
  98.      * @CustomerNeedsPasswordChange()
  99.      * @Route("/widgets/account/order/detail/{id}", name="widgets.account.order.detail", options={"seo"="false"}, methods={"GET"}, defaults={"XmlHttpRequest"=true})
  100.      *
  101.      * @throws CustomerNeedsPasswordChangeException
  102.      */
  103.     public function ajaxOrderDetail(Request $requestSalesChannelContext $context): Response
  104.     {
  105.         return parent::ajaxOrderDetail($request$context);
  106.     }
  107.     /**
  108.      * @Since("6.2.0.0")
  109.      * @LoginRequired(allowGuest=true)
  110.      * @CustomerNeedsPasswordChange()
  111.      * @Route("/account/order/edit/{orderId}", name="frontend.account.edit-order.page", methods={"GET"})
  112.      * @NoStore
  113.      *
  114.      * @throws CustomerNeedsPasswordChangeException
  115.      */
  116.     public function editOrder(string $orderIdRequest $requestSalesChannelContext $context): Response
  117.     {
  118.         return parent::editOrder($orderId$request$context);
  119.     }
  120. }