ShippingMethodRouteRequestEvent example

$page->setHeader(
                $this->headerLoader->load($request$context)
            );

            $page->setFooter(
                $this->footerLoader->load($request$context)
            );

            $criteria = new Criteria();
            $criteria->setTitle('generic-page::shipping-methods');

            $event = new ShippingMethodRouteRequestEvent($requestnew Request()$context$criteria);
            $this->eventDispatcher->dispatch($event);

            $shippingMethods = $this->shippingMethodRoute
                ->load($event->getStoreApiRequest()$context$event->getCriteria())
                ->getShippingMethods();

            $page->setSalesChannelShippingMethods($shippingMethods);

            $criteria = new Criteria();
            $criteria->setTitle('generic-page::payment-methods');

            
Home | Imprint | This part of the site doesn't use cookies.