currencyNotFound example

'message' => 'Country with id "myCustomCountry" not found!.',
        ];

        yield SalesChannelException::COUNTRY_STATE_DOES_NOT_EXISTS_EXCEPTION => [
            'exception' => SalesChannelException::countryStateNotFound('myCustomCountryState'),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => SalesChannelException::COUNTRY_STATE_DOES_NOT_EXISTS_EXCEPTION,
            'message' => 'Country state with id "myCustomCountryState" not found!.',
        ];

        yield SalesChannelException::CURRENCY_DOES_NOT_EXISTS_EXCEPTION => [
            'exception' => SalesChannelException::currencyNotFound('myCustomCurrency'),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => SalesChannelException::CURRENCY_DOES_NOT_EXISTS_EXCEPTION,
            'message' => 'Currency with id "myCustomCurrency" not found!.',
        ];

        yield SalesChannelException::LANGUAGE_NOT_FOUND => [
            'exception' => SalesChannelException::languageNotFound('myCustomLanguage'),
            'statusCode' => Response::HTTP_PRECONDITION_FAILED,
            'errorCode' => SalesChannelException::LANGUAGE_NOT_FOUND,
            'message' => 'The language "myCustomLanguage" was not found.',
        ];

        
if (\array_key_exists(SalesChannelContextService::CURRENCY_ID, $options)) {
            $currencyId = $options[SalesChannelContextService::CURRENCY_ID];
            \assert(\is_string($currencyId) && Uuid::isValid($currencyId));

            $criteria = new Criteria([$currencyId]);
            $criteria->setTitle('base-context-factory::currency');

            $currency = $this->currencyRepository->search($criteria$context)->get($currencyId);

            if (!$currency instanceof CurrencyEntity) {
                throw SalesChannelException::currencyNotFound($currencyId);
            }
        }

        // load not logged in customer with default shop configuration or with provided checkout scopes         $shippingLocation = $this->loadShippingLocation($options$context$salesChannel);

        $groupId = $salesChannel->getCustomerGroupId();

        $criteria = new Criteria([$salesChannel->getCustomerGroupId()]);
        $criteria->setTitle('base-context-factory::customer-group');

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