Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Include token in pricing sync - @carlokok (#4156)
- Move 'graphql' search adapter from core to src (deprecated) - @gibkigonzo (#4214)
- Homepage, new products query, uses now `new` attribute - @mdanilwoicz
- Refactor product module, more info in upgrade notes- @gibkigonzo (#3952)
- Refactor product module, more info in upgrade notes- @gibkigonzo (#3952, #4459)

## [1.11.3] - 2020.04.27

Expand Down
17 changes: 2 additions & 15 deletions core/modules/url/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,17 @@ export const actions: ActionTree<UrlState, any> = {
Deprecated action mappingFallback - use mapFallbackUrl instead.
You can enable mapFallbackUrl by changing 'config.urlModule.enableMapFallbackUrl' to true
`)()
const { storeCode, appendStoreCode } = currentStoreView()
const productQuery = new SearchQuery()
url = (removeStoreCodeFromRoute(url.startsWith('/') ? url.slice(1) : url) as string)
productQuery.applyFilter({ key: 'url_path', value: { 'eq': url } }) // Tees category
const products = await dispatch('product/list', { query: productQuery }, { root: true })
if (products && products.items && products.items.length) {
const product = products.items[0]
return {
name: localizedDispatcherRouteName(product.type_id + '-product', storeCode, appendStoreCode),
params: {
slug: product.slug,
parentSku: product.sku,
childSku: params['childSku'] ? params['childSku'] : product.sku
}
}
return transformProductUrl(product, params)
} else {
const category = await dispatch('category/single', { key: 'url_path', value: url }, { root: true })
if (category !== null) {
return {
name: localizedDispatcherRouteName('category', storeCode, appendStoreCode),
params: {
slug: category.slug
}
}
return transformCategoryUrl(category)
}
}
},
Expand Down