Files
kupshop/bundles/KupShop/OrderingBundle/Controller/ActivateOrderController.php
2025-08-02 16:30:27 +02:00

38 lines
1.2 KiB
PHP

<?php
namespace KupShop\OrderingBundle\Controller;
use KupShop\KupShopBundle\Routing\TranslatedRoute;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class ActivateOrderController extends AbstractController
{
/**
* @TranslatedRoute("/#activate_order#/{type}/")
*/
public function activateOrderAction(string $type): RedirectResponse
{
// Pokud nemam modul reklamace a ani vratky, tak vratim 404
if (!findModule(\Modules::RECLAMATIONS) && !findModule(\Modules::RETURNS)) {
throw new NotFoundHttpException('Module RECLAMATIONS or RETURNS not found!');
}
switch ($type) {
case 'reclamations':
return new RedirectResponse(
path('kupshop_reclamations_reclamations_createreclamationlogin'),
301
);
case 'returns':
return new RedirectResponse(
path('kupshop_returns_returns_createreturnslogin'),
301
);
}
return new RedirectResponse('/');
}
}