File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 44 <div class =" container" >
55 <breadcrumbs
66 :with-homepage =" true"
7- :routes =" [{name: 'Homepage', route_link: '/'}]"
87 :active-route =" this.$t('Order confirmation')"
98 />
109 <h2 class =" category-title" >
Original file line number Diff line number Diff line change @@ -112,13 +112,17 @@ export default {
112112 return productList
113113 },
114114 categories () {
115- const categoriesMap = {}
116- this .products .forEach (product => {
117- [... product .category ].forEach (category => {
118- categoriesMap[category .category_id ] = category
119- })
120- })
121- return Object .keys (categoriesMap).map (categoryId => categoriesMap[categoryId])
115+ const categories = this .products
116+ .filter (p => p .category )
117+ .map (p => p .category )
118+ .flat ()
119+ .filter (c => c .name )
120+
121+ const discinctCategories = Array .from (
122+ new Set (categories .map (c => c .category_id ))
123+ ).map (catId => categories .find (c => c .category_id === catId))
124+
125+ return discinctCategories
122126 },
123127 getNoResultsMessage () {
124128 let msg = ' '
Original file line number Diff line number Diff line change 22 <div class =" compare" >
33 <div class =" bg-cl-secondary py35 pl20" >
44 <div class =" container" >
5- <breadcrumbs :with-homepage =" true" :routes = " [{name: 'Homepage', route_link: '/'}] " active-route =" Compare" />
5+ <breadcrumbs :with-homepage =" true" active-route =" Compare" />
66 <h2 >{{ title }}</h2 >
77 </div >
88 </div >
You can’t perform that action at this time.
0 commit comments