diff --git a/README.md b/README.md index e8265cf..140b22d 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,8 @@ composer require shopsys/luigis-box Set these environment variables in your project: ``` -LUIGIS_BOX_IS_PRODUCTION_MODE // 'true' or 'false' LUIGIS_BOX_ENABLED_DOMAIN_IDS // comma separated list of domain ids e.g. '1,2' -LUIGIS_BOX_ACCOUNT_ID // value provided by LuigisBox company -LUIGIS_BOX_RECOMMENDATION_ALGORITHM_ID // value provided by LuigisBox company -LUIGIS_BOX_RECOMMENDATION_OFFER_ID // value provided by LuigisBox company -LUIGIS_BOX_RECOMMENDATION_LOCATION_ID // value provided by LuigisBox company -LUIGIS_BOX_SEARCH_ALGORITHM_ID // value provided by LuigisBox company -LUIGIS_BOX_SEARCH_OFFER_ID // value provided by LuigisBox company -LUIGIS_BOX_SEARCH_LOCATION_ID // value provided by LuigisBox company +LUIGIS_BOX_TRACKER_IDS_BY_DOMAIN_IDS='{"1": "", "2": "", ...}' // JSON object with domain id as key and tracker id as value ``` ## Contributing diff --git a/composer.json b/composer.json index 63dcfa0..9e5063e 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "shopsys/luigisBox", + "name": "shopsys/luigis-box", "type": "library", "description": "Shopsys Platform connector to Luigi's Box", - "keywords": ["api", "Shopsys Platform", "Luigi's Box", "SSFW", "SSP"], + "keywords": ["api", "Shopsys Platform", "Luigis Box", "SSFW", "SSP"], "license": "proprietary", "authors": [ { diff --git a/src/Component/LuigisBox/Filter/ProductFilterToLuigisBoxFilterMapper.php b/src/Component/LuigisBox/Filter/ProductFilterToLuigisBoxFilterMapper.php index b766825..41f0535 100644 --- a/src/Component/LuigisBox/Filter/ProductFilterToLuigisBoxFilterMapper.php +++ b/src/Component/LuigisBox/Filter/ProductFilterToLuigisBoxFilterMapper.php @@ -5,13 +5,14 @@ namespace Shopsys\LuigisBoxBundle\Component\LuigisBox\Filter; use Shopsys\FrameworkBundle\Component\Domain\Domain; -use Shopsys\FrameworkBundle\Component\String\TransformString; use Shopsys\FrameworkBundle\Model\Product\Availability\ProductAvailabilityFacade; -use Shopsys\FrameworkBundle\Model\Product\Brand\Brand; use Shopsys\FrameworkBundle\Model\Product\Filter\ProductFilterData; class ProductFilterToLuigisBoxFilterMapper { + public const string FILTER_OR = 'f'; + public const string FILTER_AND = 'f_must'; + /** * @param \Shopsys\FrameworkBundle\Model\Product\Availability\ProductAvailabilityFacade $productAvailabilityFacade */ @@ -21,22 +22,39 @@ public function __construct( } /** + * @param string $luigisBoxType * @param \Shopsys\FrameworkBundle\Model\Product\Filter\ProductFilterData $productFilterData * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain * @return array */ - public function mapForSearch(ProductFilterData $productFilterData, Domain $domain): array + public function mapForSearch(string $luigisBoxType, ProductFilterData $productFilterData, Domain $domain): array { - $luigisBoxFilter = []; + $luigisBoxFilter = [ + self::FILTER_AND => [], + self::FILTER_OR => [], + ]; + $luigisBoxFilter = $this->mapType($luigisBoxType, $luigisBoxFilter); $luigisBoxFilter = $this->mapPrice($productFilterData, $luigisBoxFilter); - $luigisBoxFilter = $this->mapAvailability($productFilterData, $luigisBoxFilter, $domain->getLocale()); + $luigisBoxFilter = $this->mapAvailability($productFilterData, $luigisBoxFilter); $luigisBoxFilter = $this->mapFlags($productFilterData, $luigisBoxFilter, $domain->getLocale()); $luigisBoxFilter = $this->mapBrands($productFilterData, $luigisBoxFilter); return $luigisBoxFilter; } + /** + * @param string $luigisBoxType + * @param array $luigisBoxFilter + * @return array + */ + protected function mapType(string $luigisBoxType, array $luigisBoxFilter): array + { + $luigisBoxFilter[self::FILTER_OR][] = 'type:' . $luigisBoxType; + + return $luigisBoxFilter; + } + /** * @param \Shopsys\FrameworkBundle\Model\Product\Filter\ProductFilterData $productFilterData * @param array $luigisBoxFilter @@ -44,28 +62,11 @@ public function mapForSearch(ProductFilterData $productFilterData, Domain $domai */ protected function mapPrice(ProductFilterData $productFilterData, array $luigisBoxFilter): array { - if ($productFilterData->minimalPrice !== null) { - $luigisBoxFilter['must'][] = [ - 'type' => 'customRule', - 'fields' => [ - 'price', - '$gte', - 'value', - $productFilterData->minimalPrice->getAmount(), - ], - ]; - } + if ($productFilterData->minimalPrice !== null || $productFilterData->maximalPrice !== null) { + $priceFrom = $productFilterData->minimalPrice === null ? '' : $productFilterData->minimalPrice->getAmount(); + $priceTo = $productFilterData->maximalPrice === null ? '' : $productFilterData->maximalPrice->getAmount(); - if ($productFilterData->maximalPrice !== null) { - $luigisBoxFilter['must'][] = [ - 'type' => 'customRule', - 'fields' => [ - 'price', - '$lte', - 'value', - $productFilterData->maximalPrice->getAmount(), - ], - ]; + $luigisBoxFilter[self::FILTER_AND][] = 'price:' . $priceFrom . '|' . $priceTo; } return $luigisBoxFilter; @@ -74,26 +75,14 @@ protected function mapPrice(ProductFilterData $productFilterData, array $luigisB /** * @param \Shopsys\FrameworkBundle\Model\Product\Filter\ProductFilterData $productFilterData * @param array $luigisBoxFilter - * @param string $locale * @return array */ protected function mapAvailability( ProductFilterData $productFilterData, array $luigisBoxFilter, - string $locale, ): array { if ($productFilterData->inStock === true) { - $luigisBoxFilter['must'] = [ - [ - 'type' => 'customRule', - 'fields' => [ - 'availability', - '$in', - 'value', - $this->productAvailabilityFacade->getOnStockText($locale), - ], - ], - ]; + $luigisBoxFilter[self::FILTER_AND][] = 'availability:1'; } return $luigisBoxFilter; @@ -109,15 +98,7 @@ protected function mapFlags(ProductFilterData $productFilterData, array $luigisB { if (count($productFilterData->flags) > 0) { foreach ($productFilterData->flags as $flag) { - $luigisBoxFilter['must'][] = [ - 'type' => 'customRule', - 'fields' => [ - 'tag' . TransformString::safeFilename($flag->getName($locale)), - '$in', - 'value', - 'true', - ], - ]; + $luigisBoxFilter[self::FILTER_OR][] = 'labels:' . $flag->getName($locale); } } @@ -132,17 +113,9 @@ protected function mapFlags(ProductFilterData $productFilterData, array $luigisB protected function mapBrands(ProductFilterData $productFilterData, array $luigisBoxFilter): array { if (count($productFilterData->brands) > 0) { - $luigisBoxFilter['must'] = [ - [ - 'type' => 'customRule', - 'fields' => [ - 'brand', - '$in', - 'value', - '"' . implode('","', array_map(static fn (Brand $brand) => $brand->getName(), $productFilterData->brands)) . '"', - ], - ], - ]; + foreach ($productFilterData->brands as $brand) { + $luigisBoxFilter[self::FILTER_OR][] = 'brand:' . $brand->getName(); + } } return $luigisBoxFilter; diff --git a/src/Component/LuigisBox/LuigisBoxClient.php b/src/Component/LuigisBox/LuigisBoxClient.php index d3452e6..de17d84 100644 --- a/src/Component/LuigisBox/LuigisBoxClient.php +++ b/src/Component/LuigisBox/LuigisBoxClient.php @@ -4,64 +4,66 @@ namespace Shopsys\LuigisBoxBundle\Component\LuigisBox; +use Shopsys\ArticleFeed\LuigisBoxBundle\Model\LuigisBoxArticleFeedItem; +use Shopsys\CategoryFeed\LuigisBoxBundle\Model\FeedItem\LuigisBoxCategoryFeedItem; +use Shopsys\FrameworkBundle\Component\Domain\Domain; +use Shopsys\FrameworkBundle\Model\Product\Listing\ProductListOrderingConfig; use Shopsys\LuigisBoxBundle\Component\LuigisBox\Exception\LuigisBoxIndexNotRecognizedException; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; +use Shopsys\ProductFeed\LuigisBoxBundle\Model\FeedItem\LuigisBoxProductFeedItem; class LuigisBoxClient { - protected const WEBSERVER_NAME = 'shopsys-api'; - protected const LUIGIS_BOX_PARAMETER_PREFIX = 'luigisBox'; - protected const LUIGIS_BOX_PARAMETER_ALGORITHM_ID = 'algorithm_id'; - protected const LUIGIS_BOX_PARAMETER_OFFER_ID = 'offer_id'; - protected const LUIGIS_BOX_PARAMETER_LOCATION_ID = 'location_id'; - public const LUIGIS_BOX_INDEX_PRODUCTS = 'products'; - public const LUIGIS_BOX_INDEX_CATEGORIES = 'categories'; - public const LUIGIS_BOX_INDEX_ARTICLES = 'articles'; - public const LUIGIS_BOX_EVENT_GET_RECOMMENDATION = 'getRecommendation'; - public const LUIGIS_BOX_ACTION_SEARCH = 'search'; - public const LUIGIS_BOX_ACTION_RECOMMENDATION = 'recommendation'; + public const string LUIGIS_BOX_TYPE_PRODUCT = 'item'; + public const string LUIGIS_BOX_ENDPOINT_SEARCH = 'search'; + public const string LUIGIS_BOX_ENDPOINT_AUTOCOMPLETE = 'autocomplete/v2'; /** * @param string $luigisBoxApiUrl - * @param string $luigisBoxAccountId - * @param bool $luigisBoxIsProductionMode - * @param \Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag + * @param array $trackerIdsByDomainIds + * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain */ public function __construct( protected readonly string $luigisBoxApiUrl, - protected readonly string $luigisBoxAccountId, - protected readonly bool $luigisBoxIsProductionMode, - protected readonly ParameterBagInterface $parameterBag, + protected readonly array $trackerIdsByDomainIds, + protected readonly Domain $domain, ) { } protected function checkNecessaryConfigurationIsSet(): void { - if ($this->luigisBoxAccountId === '') { - throw new LuigisBoxIndexNotRecognizedException('Luigi\'s Box account ID is not set.'); + if (array_key_exists($this->domain->getId(), $this->trackerIdsByDomainIds) === false) { + throw new LuigisBoxIndexNotRecognizedException( + sprintf('Luigi\'s Box tracker ID is not set for domain with ID: "%d".', $this->domain->getId()), + ); } } + /** + * @return string + */ + protected function getTrackerId(): string + { + return $this->trackerIdsByDomainIds[$this->domain->getId()]; + } + /** * @param string $query - * @param string $index - * @param string $action + * @param string $type + * @param string $endpoint * @param int $page * @param int $limit * @param array $filter - * @param string $browserId - * @param string $requestingPage + * @param string|null $orderingMode * @return \Shopsys\LuigisBoxBundle\Component\LuigisBox\LuigisBoxResult */ public function getData( string $query, - string $index, - string $action, + string $type, + string $endpoint, int $page, int $limit, - array $filter = [], - string $browserId = 'AAABQAg1a7sMJnpF6WlwIFuC', - string $requestingPage = 'http://127.0.0.1:8000/', + array $filter, + ?string $orderingMode, ): LuigisBoxResult { $this->checkNecessaryConfigurationIsSet(); @@ -69,13 +71,12 @@ public function getData( file_get_contents( $this->getLuigisBoxApiUrl( $query, - $index, - $action, + $type, + $endpoint, $page, $limit, $filter, - $browserId, - $requestingPage, + $orderingMode, ), ), true, @@ -83,143 +84,115 @@ public function getData( JSON_THROW_ON_ERROR, ); + if ($endpoint === self::LUIGIS_BOX_ENDPOINT_SEARCH) { + $data = $data['results']; + } + + $ids = []; + + foreach ($data['hits'] as $hit) { + $ids[] = $this->getIdFromIdentity($hit['url']); + } + return new LuigisBoxResult( - $data['data']['itemFieldValues'][$this->getIdFieldNameByIndex($index)], - $data['data']['itemsCount'], + $ids, + $this->getTotalHitsFromData($data, $endpoint), ); } + /** + * @param array $data + * @param string $endpoint + * @return int + */ + protected function getTotalHitsFromData(array $data, string $endpoint): int + { + if ($endpoint === self::LUIGIS_BOX_ENDPOINT_AUTOCOMPLETE) { + return (int)$data['exact_match_hits_count'] + (int)$data['partial_match_hits_count']; + } + + return $data['total_hits']; + } + /** * @param string $query - * @param string $index - * @param string $action - * @param int $page + * @param string $type + * @param string $endpoint + * @param int $offset * @param int $limit * @param array $filter - * @param string $browserId - * @param string $requestingPage + * @param string|null $orderingMode * @return string */ protected function getLuigisBoxApiUrl( string $query, - string $index, - string $action, - int $page, + string $type, + string $endpoint, + int $offset, int $limit, array $filter, - string $browserId, - string $requestingPage, + ?string $orderingMode, ): string { - return $this->luigisBoxApiUrl . - $this->luigisBoxAccountId . '/' . - $this->getEnvironmentId() . '/' . - 'workflow.json?_t=' . $this->getTimestampInMilliseconds() . - '&_a=' . urlencode($this->getWebserverName()) . - '&_e=' . self::LUIGIS_BOX_EVENT_GET_RECOMMENDATION . - '&_url=' . urlencode($requestingPage) . - '&algorithmID=' . $this->getAlgorithmId($action) . - '&offerID=' . $this->getOfferId($action) . - '&locationID=' . $this->getLocationId($action) . - '&query=' . urlencode('"' . $query . '"') . - '&itemsPerPage=' . $limit . - '&page=' . $page . - '&index=' . urlencode($index) . - '&_vid=' . urlencode($browserId) . - ($filter !== [] ? '&boolQuery=' . urlencode(json_encode($filter, JSON_THROW_ON_ERROR)) : '') . - '&idsOnly=' . $this->getOnlyIds(); - } - - /** - * @return string - */ - protected function getEnvironmentId(): string - { - return $this->luigisBoxIsProductionMode === true ? 'p' : 'test'; - } - - /** - * @return int - */ - protected function getTimestampInMilliseconds(): int - { - return (int)floor(microtime(true) * 1000); - } - - /** - * @return string - */ - protected function getWebserverName(): string - { - return static::WEBSERVER_NAME; - } - - /** - * @param string $action - * @param string $name - * @return string - */ - protected function getParameterByActionAndName(string $action, string $name): string - { - $parameterName = static::LUIGIS_BOX_PARAMETER_PREFIX . '.' . $action . '.' . $name; - - if (!$this->parameterBag->has($parameterName)) { - throw new LuigisBoxIndexNotRecognizedException( - sprintf('LuigisBox ENV variable for event "%s" with name "%s" or parameter "%s" is not set.', $action, $name, $parameterName), - ); + $url = $this->luigisBoxApiUrl . + $endpoint . '/' . + '?tracker_id=' . $this->getTrackerId() . + '&q=' . urlencode('"' . $query . '"'); + + if ($endpoint === self::LUIGIS_BOX_ENDPOINT_SEARCH) { + $url .= '&hit_fields=identity' . + '&size=' . $limit . + '&from=' . $offset; + + foreach ($filter as $key => $filterValues) { + foreach ($filterValues as $filterValue) { + $url .= '&' . $key . '[]=' . urlencode($filterValue); + } + } + + $orderingMode = $this->getOrderingMode($orderingMode); + + if ($orderingMode !== null) { + $url .= '&sort=' . $orderingMode; + } } - return $this->parameterBag->get($parameterName); - } - - /** - * @param string $action - * @return string - */ - protected function getAlgorithmId(string $action): string - { - return $this->getParameterByActionAndName($action, static::LUIGIS_BOX_PARAMETER_ALGORITHM_ID); - } - - /** - * @param string $action - * @return string - */ - protected function getOfferId(string $action): string - { - return $this->getParameterByActionAndName($action, static::LUIGIS_BOX_PARAMETER_OFFER_ID); - } + if ($endpoint === self::LUIGIS_BOX_ENDPOINT_AUTOCOMPLETE) { + $url .= '&type=' . $type . ':' . $limit; + } - /** - * @param string $action - * @return string - */ - protected function getLocationId(string $action): string - { - return $this->getParameterByActionAndName($action, static::LUIGIS_BOX_PARAMETER_LOCATION_ID); + return $url; } /** - * @return string + * @param string|null $orderingMode + * @return string|null */ - protected function getOnlyIds(): string + protected function getOrderingMode(?string $orderingMode): ?string { - return 'true'; + return match ($orderingMode) { + ProductListOrderingConfig::ORDER_BY_NAME_ASC => 'name:asc', + ProductListOrderingConfig::ORDER_BY_NAME_DESC => 'name:desc', + ProductListOrderingConfig::ORDER_BY_PRICE_ASC => 'price:asc', + ProductListOrderingConfig::ORDER_BY_PRICE_DESC => 'price:desc', + default => null, + }; } /** - * @param string $index - * @return string + * @param string $identity + * @return int */ - protected function getIdFieldNameByIndex(string $index): string + protected function getIdFromIdentity(string $identity): int { - if ($index === 'products') { - return 'id'; - } - - if ($index === 'categories') { - return 'categoryId'; - } - - throw new LuigisBoxIndexNotRecognizedException(sprintf('Luigi\'s Box index "%s" is not recognized.', $index)); + return (int)str_replace( + [ + LuigisBoxProductFeedItem::UNIQUE_IDENTIFIER_PREFIX, + LuigisBoxCategoryFeedItem::UNIQUE_IDENTIFIER_PREFIX, + LuigisBoxArticleFeedItem::UNIQUE_BLOG_ARTICLE_IDENTIFIER_PREFIX, + LuigisBoxArticleFeedItem::UNIQUE_ARTICLE_IDENTIFIER_PREFIX, + ], + '', + $identity, + ); } } diff --git a/src/DependencyInjection/ShopsysLuigisBoxExtension.php b/src/DependencyInjection/ShopsysLuigisBoxExtension.php index e2e23e4..1cd906f 100644 --- a/src/DependencyInjection/ShopsysLuigisBoxExtension.php +++ b/src/DependencyInjection/ShopsysLuigisBoxExtension.php @@ -20,9 +20,5 @@ public function load(array $configs, ContainerBuilder $container): void $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('services.yaml'); $loader->load('parameters.yaml'); - - if ($container->getParameter('kernel.environment') === EnvironmentType::TEST) { - $loader->load('services_test.yaml'); - } } } diff --git a/src/Model/Product/ProductSearchResultsProvider.php b/src/Model/Product/ProductSearchResultsProvider.php index c0ca503..b5daa30 100644 --- a/src/Model/Product/ProductSearchResultsProvider.php +++ b/src/Model/Product/ProductSearchResultsProvider.php @@ -9,6 +9,7 @@ use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Model\Customer\User\CurrentCustomerUser; use Shopsys\FrameworkBundle\Model\Product\Filter\ProductFilterData; +use Shopsys\FrameworkBundle\Model\Product\Listing\ProductListOrderingConfig; use Shopsys\FrameworkBundle\Model\Product\Search\FilterQueryFactory; use Shopsys\FrameworkBundle\Model\Product\Search\ProductElasticsearchRepository; use Shopsys\FrontendApiBundle\Model\Product\Connection\ProductConnection; @@ -75,12 +76,21 @@ public function getProductsSearchResults( $search = $argument['search'] ?? ''; $limit = $argument['first'] ?? 0; $after = $argument['after'] ?? null; + $orderingMode = $argument['orderingMode'] === null || $argument['orderingMode'] === ProductListOrderingConfig::ORDER_BY_RELEVANCE ? null : $argument['orderingMode']; $connectionBuilder = new ConnectionBuilder(); $offset = $connectionBuilder->getOffsetWithDefault($after, -1) + 1; - $page = $this->getPageFromOffsetAndLimit($offset, $limit); - $luigisBoxFilter = $this->productFilterToLuigisBoxFilterMapper->mapForSearch($productFilterData, $this->domain); - $result = $this->client->getData($search, LuigisBoxClient::LUIGIS_BOX_INDEX_PRODUCTS, LuigisBoxClient::LUIGIS_BOX_ACTION_SEARCH, $page, $limit, $luigisBoxFilter); + $luigisBoxFilter = $this->productFilterToLuigisBoxFilterMapper->mapForSearch(LuigisBoxClient::LUIGIS_BOX_TYPE_PRODUCT, $productFilterData, $this->domain); + + $result = $this->client->getData( + $search, + LuigisBoxClient::LUIGIS_BOX_TYPE_PRODUCT, + $argument['isAutocomplete'] === true ? LuigisBoxClient::LUIGIS_BOX_ENDPOINT_AUTOCOMPLETE : LuigisBoxClient::LUIGIS_BOX_ENDPOINT_SEARCH, + $offset, + $limit, + $luigisBoxFilter, + $orderingMode, + ); $filterQuery = $this->filterQueryFactory->createSellableProductsByProductIdsFilter($result->getIds(), $limit); $sortedProducts = $this->productElasticsearchRepository->getSortedProductsResultByFilterQuery($filterQuery)->getHits(); @@ -95,14 +105,4 @@ public function getProductsSearchResults( $this->productOrderingModeProvider->getOrderingModeFromArgument($argument), ); } - - /** - * @param int $offset - * @param int $limit - * @return int - */ - protected function getPageFromOffsetAndLimit(int $offset, int $limit): int - { - return (int)ceil($offset / $limit); - } } diff --git a/src/Resources/config/parameters.yaml b/src/Resources/config/parameters.yaml index e175bc3..a596393 100644 --- a/src/Resources/config/parameters.yaml +++ b/src/Resources/config/parameters.yaml @@ -1,18 +1,4 @@ parameters: - env(LUIGIS_BOX_API_URL): 'https://rtp.luigisBox.ai/' - env(LUIGIS_BOX_ACCOUNT_ID): '' - env(LUIGIS_BOX_IS_PRODUCTION_MODE): 'false' - env(LUIGIS_BOX_RECOMMENDATION_ALGORITHM_ID): '' - luigisBox.recommendation.algorithm_id: '%env(LUIGIS_BOX_RECOMMENDATION_ALGORITHM_ID)%' - env(LUIGIS_BOX_RECOMMENDATION_OFFER_ID): '' - luigisBox.recommendation.offer_id: '%env(LUIGIS_BOX_RECOMMENDATION_OFFER_ID)%' - env(LUIGIS_BOX_RECOMMENDATION_LOCATION_ID): '' - luigisBox.recommendation.location_id: '%env(LUIGIS_BOX_RECOMMENDATION_LOCATION_ID)%' - env(LUIGIS_BOX_SEARCH_ALGORITHM_ID): '' - luigisBox.search.algorithm_id: '%env(LUIGIS_BOX_SEARCH_ALGORITHM_ID)%' - env(LUIGIS_BOX_SEARCH_OFFER_ID): '' - luigisBox.search.offer_id: '%env(LUIGIS_BOX_SEARCH_OFFER_ID)%' - env(LUIGIS_BOX_SEARCH_LOCATION_ID): '' - luigisBox.search.location_id: '%env(LUIGIS_BOX_SEARCH_LOCATION_ID)%' + env(LUIGIS_BOX_API_URL): 'https://live.luigisbox.com/' env(LUIGIS_BOX_ENABLED_DOMAIN_IDS): '' - luigisBox.enabled_domain_ids: '%env(LUIGIS_BOX_ENABLED_DOMAIN_IDS)%' + env(LUIGIS_BOX_TRACKER_IDS_BY_DOMAIN_IDS): '{}' diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 7df73e3..8f3803f 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -7,13 +7,12 @@ services: Shopsys\LuigisBoxBundle\Component\LuigisBox\LuigisBoxClient: arguments: $luigisBoxApiUrl: '%env(string:LUIGIS_BOX_API_URL)%' - $luigisBoxAccountId: '%env(string:LUIGIS_BOX_ACCOUNT_ID)%' - $luigisBoxIsProductionMode: '%env(bool:LUIGIS_BOX_IS_PRODUCTION_MODE)%' + $trackerIdsByDomainIds: '%env(json:LUIGIS_BOX_TRACKER_IDS_BY_DOMAIN_IDS)%' Shopsys\LuigisBoxBundle\Component\LuigisBox\Filter\ProductFilterToLuigisBoxFilterMapper: ~ Shopsys\LuigisBoxBundle\Model\Product\ProductSearchResultsProvider: arguments: - $enabledDomainIds: '%luigisBox.enabled_domain_ids%' + $enabledDomainIds: '%env(LUIGIS_BOX_ENABLED_DOMAIN_IDS)%' tags: - { name: 'shopsys.frontend_api.products_search_results_provider', priority: 100 } diff --git a/src/Resources/config/services_test.yaml b/src/Resources/config/services_test.yaml deleted file mode 100644 index 2f7aa4c..0000000 --- a/src/Resources/config/services_test.yaml +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - luigisBox.enabled_domain_ids: '' - -services: - _defaults: - autowire: true - autoconfigure: true - public: false