getSalutations example

throw CartException::customerNotLoggedIn();
        }

        $page = $this->genericLoader->load($request$salesChannelContext);

        $page = AccountProfilePage::createFrom($page);

        if ($page->getMetaInformation()) {
            $page->getMetaInformation()->setRobots('noindex,follow');
        }

        $page->setSalutations($this->getSalutations($salesChannelContext$request));

        $this->eventDispatcher->dispatch(
            new AccountProfilePageLoadedEvent($page$salesChannelContext$request)
        );

        return $page;
    }

    private function getSalutations(SalesChannelContext $context, Request $request): SalutationCollection
    {
        $event = new SalutationRouteRequestEvent($requestnew Request()$contextnew Criteria());
        


    public function handle(ConditionInterface $condition, QueryBuilder $query)
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(SalutationCondition $condition, QueryBuilder $query): void
    {
        $query->andWhere('customer.salutation IN (:salutations)');

        $query->setParameter(':salutations', $condition->getSalutations(), Connection::PARAM_STR_ARRAY);
    }
}

        $page = $this->genericLoader->load($request$salesChannelContext);

        $page = AccountLoginPage::createFrom($page);

        if ($page->getMetaInformation()) {
            $page->getMetaInformation()->setRobots('noindex,follow');
        }

        $page->setCountries($this->getCountries($salesChannelContext));

        $page->setSalutations($this->getSalutations($salesChannelContext));

        $this->eventDispatcher->dispatch(
            new AccountLoginPageLoadedEvent($page$salesChannelContext$request)
        );

        return $page;
    }

    /** * @throws InconsistentCriteriaIdsException */
    


    public function handle(ConditionInterface $condition, QueryBuilder $query): void
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(NotSalutationCondition $condition, QueryBuilder $query): void
    {
        $query->andWhere('customer.salutation NOT IN (:salutations)');

        $query->setParameter(':salutations', $condition->getSalutations(), Connection::PARAM_STR_ARRAY);
    }
}

    public function load(Request $request, SalesChannelContext $salesChannelContext, CustomerEntity $customer): AddressListingPage
    {
        $page = $this->genericLoader->load($request$salesChannelContext);

        $page = AddressListingPage::createFrom($page);

        $page->setSalutations($this->getSalutations($salesChannelContext));

        $page->setCountries($this->getCountries($salesChannelContext));

        $criteria = (new Criteria())->addSorting(new FieldSorting('firstName', FieldSorting::ASCENDING));

        $page->setAddresses($this->listAddressRoute->load($criteria$salesChannelContext$customer)->getAddressCollection());

        $page->setCart($this->cartService->getCart($salesChannelContext->getToken()$salesChannelContext));

        $page->setAddress(
            $page->getAddresses()->get($request->get('addressId'))
        );


    public function collect(CmsSlotEntity $slot, ResolverContext $resolverContext): ?CriteriaCollection
    {
        return null;
    }

    public function enrich(CmsSlotEntity $slot, ResolverContext $resolverContext, ElementDataCollection $result): void
    {
        $context = $resolverContext->getSalesChannelContext();

        $salutations = $this->salutationRoute->load(new Request()$contextnew Criteria())->getSalutations();

        $salutations->sort(fn (SalutationEntity $a, SalutationEntity $b) => $b->getSalutationKey() <=> $a->getSalutationKey());

        $slot->setData($salutations);
    }
}

    public function load(Request $request, SalesChannelContext $salesChannelContext, CustomerEntity $customer): AddressDetailPage
    {
        $page = $this->genericLoader->load($request$salesChannelContext);

        $page = AddressDetailPage::createFrom($page);

        if ($page->getMetaInformation()) {
            $page->getMetaInformation()->setRobots('noindex,follow');
        }

        $page->setSalutations($this->getSalutations($salesChannelContext));

        $page->setCountries($this->getCountries($salesChannelContext));

        $page->setAddress($this->getAddress($request$salesChannelContext$customer));

        $this->eventDispatcher->dispatch(
            new AddressDetailPageLoadedEvent($page$salesChannelContext$request)
        );

        return $page;
    }

    

        $page = $this->genericLoader->load($request$salesChannelContext);

        $page = CheckoutRegisterPage::createFrom($page);

        if ($page->getMetaInformation()) {
            $page->getMetaInformation()->setRobots('noindex,follow');
        }

        $page->setCountries($this->getCountries($salesChannelContext));
        $page->setCart($this->cartService->getCart($salesChannelContext->getToken()$salesChannelContext));
        $page->setSalutations($this->getSalutations($salesChannelContext));

        $addressId = $request->attributes->get('addressId');
        if ($addressId) {
            $address = $this->getById((string) $addressId$salesChannelContext);
            $page->setAddress($address);
        }

        $this->eventDispatcher->dispatch(
            new CheckoutRegisterPageLoadedEvent($page$salesChannelContext$request)
        );

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