<?php declare(strict_types=1);
namespace Samson\Controller;
/***
*
* This file is part of the "SAMSON Shop" project.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2024
*
***/
use Samson\Exception\CustomerNeedsPasswordChangeException;
use Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException;
use Shopware\Core\Checkout\Order\SalesChannel\AbstractCancelOrderRoute;
use Shopware\Core\Checkout\Order\SalesChannel\AbstractOrderRoute;
use Shopware\Core\Checkout\Order\SalesChannel\AbstractSetPaymentOrderRoute;
use Shopware\Core\Checkout\Order\SalesChannel\OrderService;
use Shopware\Core\Checkout\Payment\SalesChannel\AbstractHandlePaymentMethodRoute;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextServiceInterface;
use Shopware\Core\System\SalesChannel\SalesChannel\AbstractContextSwitchRoute;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Core\System\SystemConfig\SystemConfigService;
use Shopware\Storefront\Controller\AccountOrderController as ShopwareAccountOrderController;
use Shopware\Storefront\Page\Account\Order\AccountEditOrderPageLoader;
use Shopware\Storefront\Page\Account\Order\AccountOrderDetailPageLoader;
use Shopware\Storefront\Page\Account\Order\AccountOrderPageLoader;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Samson\Annotation\CustomerNeedsPasswordChange;
use Shopware\Core\Framework\Routing\Annotation\LoginRequired;
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Storefront\Framework\Routing\Annotation\NoStore;
use Symfony\Component\Routing\Annotation\Route;
/**
* @RouteScope(scopes={"storefront"})
*/
class AccountOrderController extends ShopwareAccountOrderController
{
public function __construct(AccountOrderPageLoader $orderPageLoader,
AccountEditOrderPageLoader $accountEditOrderPageLoader,
AbstractContextSwitchRoute $contextSwitchRoute,
AbstractCancelOrderRoute $cancelOrderRoute,
AbstractSetPaymentOrderRoute $setPaymentOrderRoute,
AbstractHandlePaymentMethodRoute $handlePaymentMethodRoute,
EventDispatcherInterface $eventDispatcher,
AccountOrderDetailPageLoader $orderDetailPageLoader,
AbstractOrderRoute $orderRoute,
SalesChannelContextServiceInterface $contextService,
SystemConfigService $systemConfigService,
OrderService $orderService)
{
parent::__construct($orderPageLoader,
$accountEditOrderPageLoader,
$contextSwitchRoute,
$cancelOrderRoute,
$setPaymentOrderRoute,
$handlePaymentMethodRoute,
$eventDispatcher,
$orderDetailPageLoader,
$orderRoute,
$contextService,
$systemConfigService,
$orderService);
}
/**
* @Since("6.0.0.0")
* @LoginRequired(allowGuest=true)
* @CustomerNeedsPasswordChange()
* @Route("/account/order", name="frontend.account.order.page", options={"seo"="false"}, methods={"GET", "POST"}, defaults={"XmlHttpRequest"=true})
* @NoStore
*
* @throws CustomerNotLoggedInException
* @throws CustomerNeedsPasswordChangeException
*/
public function orderOverview(Request $request, SalesChannelContext $context): Response
{
return parent::orderOverview($request, $context);
}
/**
* @Since("6.2.0.0")
* @CustomerNeedsPasswordChange()
* @Route("/account/order/{deepLinkCode}", name="frontend.account.order.single.page", options={"seo"="false"}, methods={"GET", "POST"})
* @NoStore
*
* @throws CustomerNotLoggedInException
* @throws CustomerNeedsPasswordChangeException
*/
public function orderSingleOverview(Request $request, SalesChannelContext $context): Response
{
return parent::orderSingleOverview($request, $context);
}
/**
* @Since("6.0.0.0")
* @LoginRequired()
* @CustomerNeedsPasswordChange()
* @Route("/widgets/account/order/detail/{id}", name="widgets.account.order.detail", options={"seo"="false"}, methods={"GET"}, defaults={"XmlHttpRequest"=true})
*
* @throws CustomerNeedsPasswordChangeException
*/
public function ajaxOrderDetail(Request $request, SalesChannelContext $context): Response
{
return parent::ajaxOrderDetail($request, $context);
}
/**
* @Since("6.2.0.0")
* @LoginRequired(allowGuest=true)
* @CustomerNeedsPasswordChange()
* @Route("/account/order/edit/{orderId}", name="frontend.account.edit-order.page", methods={"GET"})
* @NoStore
*
* @throws CustomerNeedsPasswordChangeException
*/
public function editOrder(string $orderId, Request $request, SalesChannelContext $context): Response
{
return parent::editOrder($orderId, $request, $context);
}
}