enrichCustomerContext example



        if (empty($customerPayload) || !empty($customerPayload['permissions'])) {
            return $this->replaceContextToken($customerId$currentContext$token);
        }

        $customerContext = $this->factory->create($customerPayload['token']$currentContext->getSalesChannel()->getId()$customerPayload);
        if ($customerPayload['expired'] ?? false) {
            $customerContext = $this->replaceContextToken($customerId$customerContext$token);
        }

        return $this->enrichCustomerContext($customerContext$currentContext$token$customerId);
    }

    /** * This function restores the context by the given customer id. If a context with this customer id doesn't exist, the context will * create with the customer id in the main customerId table column. * So, the context is directly referenced to the customer. */
    public function restore(string $customerId, SalesChannelContext $currentContext): SalesChannelContext
    {
        $customerPayload = $this->contextPersister->load(
            $currentContext->getToken(),
            
Home | Imprint | This part of the site doesn't use cookies.