diff --git a/CHANGELOG.md b/CHANGELOG.md index e9211497d4..2409897db9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Redirect from checkout to home with a proper store code - @Fifciu - Added back error notification when user selects invalid configuration - @1070rik (#4033) - findConfigurableChildAsync - return best match for configurable variant - @gibkigonzo (#4042) +- use storeCode for mappingFallback url - @gibkigonzo (#4050) ### Changed / Improved - Optimized `translation.processor` to process only enabled locale CSV files - @pkarw (#3950) diff --git a/core/modules/url/store/actions.ts b/core/modules/url/store/actions.ts index 44fcdd5277..a4fba7ac0e 100644 --- a/core/modules/url/store/actions.ts +++ b/core/modules/url/store/actions.ts @@ -8,7 +8,7 @@ import queryString from 'query-string' import config from 'config' import { SearchQuery } from 'storefront-query-builder' import { preProcessDynamicRoutes, normalizeUrlPath, parametrizeRouteData, getFallbackRouteData } from '../helpers' -import { removeStoreCodeFromRoute, currentStoreView, localizedDispatcherRouteName } from '@vue-storefront/core/lib/multistore' +import { removeStoreCodeFromRoute, currentStoreView, localizedDispatcherRouteName, adjustMultistoreApiUrl } from '@vue-storefront/core/lib/multistore' import storeCodeFromRoute from '@vue-storefront/core/lib/storeCodeFromRoute' import fetch from 'isomorphic-fetch' import { Logger } from '@vue-storefront/core/lib/logger' @@ -135,8 +135,7 @@ export const actions: ActionTree = { */ async getFallbackByUrl (context, { url }) { try { - const { elasticsearch } = currentStoreView() - const requestUrl = `${processURLAddress(config.urlModule.map_endpoint)}/${elasticsearch.index}` + const requestUrl = `${adjustMultistoreApiUrl(processURLAddress(config.urlModule.map_endpoint))}` let response: any = await fetch( requestUrl, { @@ -190,8 +189,7 @@ export const actions: ActionTree = { async saveFallbackData ({ commit }, { _type, _source }) { switch (_type) { case 'product': { - configureChildren(_source) - storeProductToCache(_source, 'sku') + // TODO: find a way to cache simple, configurable, group, bundle or custom_options products break } case 'category': {