custom/plugins/WbfkOffer/src/Subscriber/SetPaymentOrderRouteRequestEventSubscriber.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Wbfk\Offer\Subscriber;
  4. use JetBrains\PhpStorm\NoReturn;
  5. use Shopware\Storefront\Event\RouteRequest\SetPaymentOrderRouteRequestEvent;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class SetPaymentOrderRouteRequestEventSubscriber implements EventSubscriberInterface
  8. {
  9.     public static function getSubscribedEvents(): array
  10.     {
  11.         return [
  12.             SetPaymentOrderRouteRequestEvent::class => 'onSetPaymentOrderRouteRequestEvent',
  13.         ];
  14.     }
  15.     public function onSetPaymentOrderRouteRequestEvent(SetPaymentOrderRouteRequestEvent $event): void
  16.     {
  17.         if ($event->getStorefrontRequest()->get('deepLinkCode'false)) {
  18.             $event->getStoreApiRequest()->attributes->set('deepLinkCode'$event->getStorefrontRequest()->get('deepLinkCode'));
  19.         }
  20.     }
  21. }