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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added validation message for city field on checkout page - @dz3n (#3723)
- Make price calculation based on saved original prices - @gibkigonzo (#3740)
- Improving is_comparable to work with booleans and digits - @dz3n (#3697)
- Fixed displaying categories on search menu - @andrzejewsky (#3758)
- Fixed broken link for store locator - @andrzejewsky (#3754)
- Fixed instant checkout functionality - @andrzejewsky (#3765)
- Fixed links to the promoted banners - @andrzejewsky (#3753)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ export default {
return productList
},
categories () {
const categoriesMap = {}
this.products.forEach(product => {
[...product.category].forEach(category => {
categoriesMap[category.category_id] = category
})
})
return Object.keys(categoriesMap).map(categoryId => categoriesMap[categoryId])
const categories = this.products
.filter(p => p.category)
.map(p => p.category)
.flat()

const discinctCategories = Array.from(
new Set(categories.map(c => c.category_id))
).map(catId => categories.find(c => c.category_id === catId))

return discinctCategories
},
getNoResultsMessage () {
let msg = ''
Expand Down