setSalesChannelPaymentMethods example

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

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

            $paymentMethods = $this->paymentMethodRoute
                ->load($event->getStoreApiRequest()$context$event->getCriteria())
                ->getPaymentMethods();

            $page->setSalesChannelPaymentMethods($paymentMethods);

            $page->setMetaInformation((new MetaInformation())->assign([
                'revisit' => '15 days',
                'robots' => 'index,follow',
                'xmlLang' => $request->attributes->get(SalesChannelRequest::ATTRIBUTE_DOMAIN_LOCALE) ?? '',
                'metaTitle' => $this->systemConfigService->getString('core.basicInformation.shopName', $context->getSalesChannel()->getId()),
            ]));

            $this->eventDispatcher->dispatch(
                new GenericPageLoadedEvent($page$context$request)
            );

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