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 @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for ES7 - @andrzejewsky (#3690)
- Added unit tests for `core/modules/mailer` - @krskibin (#3710)
- Get payment methods with billing address data - @rain2o (#2878)
- Added custom page-size parameter for `category-next/loadCategoryProducts` action - @cewald (#3713, #3714)

## [1.11.0-rc.1] - 2019.10.03

Expand Down
1 change: 1 addition & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"setupVariantByAttributeCode": true,
"endpoint": "/api/product",
"defaultFilters": ["color", "size", "price", "erin_recommends"],
"systemFilterNames": ["sort"],
"maxFiltersQuerySize": 999,
"routerFiltersSource": "query",
"filterFieldMapping": {
Expand Down
5 changes: 3 additions & 2 deletions core/modules/catalog-next/helpers/filterHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FilterVariant from 'core/modules/catalog-next/types/FilterVariant';
import config from 'config'
import FilterVariant from 'core/modules/catalog-next/types/FilterVariant'

export const getSystemFilterNames: string[] = ['sort']
export const getSystemFilterNames: string[] = config.products.systemFilterNames

/**
* Creates new filtersQuery (based on currentQuery) by modifying specific filter variant.
Expand Down
5 changes: 3 additions & 2 deletions core/modules/catalog-next/store/category/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import omit from 'lodash-es/omit'
import config from 'config'

const actions: ActionTree<CategoryState, RootState> = {
async loadCategoryProducts ({ commit, getters, dispatch, rootState }, { route, category } = {}) {
async loadCategoryProducts ({ commit, getters, dispatch, rootState }, { route, category, pageSize = 50 } = {}) {
const searchCategory = category || getters.getCategoryFrom(route.path) || {}
const categoryMappedFilters = getters.getFiltersMap[searchCategory.id]
const areFiltersInQuery = !!Object.keys(route[products.routerFiltersSource]).length
Expand All @@ -36,7 +36,8 @@ const actions: ActionTree<CategoryState, RootState> = {
query: filterQr,
sort: searchQuery.sort,
includeFields: entities.productList.includeFields,
excludeFields: entities.productList.excludeFields
excludeFields: entities.productList.excludeFields,
size: pageSize
})
await dispatch('loadAvailableFiltersFrom', {aggregations, category: searchCategory, filters: searchQuery.filters})
commit(types.CATEGORY_SET_SEARCH_PRODUCTS_STATS, { perPage, start, total })
Expand Down
2 changes: 1 addition & 1 deletion core/modules/catalog-next/store/category/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const getters: GetterTree<CategoryState, RootState> = {
getCurrentSearchQuery: (state, getters, rootState) => getters.getCurrentFiltersFrom(rootState.route[products.routerFiltersSource]),
getCurrentFilters: (state, getters) => getters.getCurrentSearchQuery.filters,
hasActiveFilters: (state, getters) => !!Object.keys(getters.getCurrentFilters).length,
getSystemFilterNames: () => ['sort'],
getSystemFilterNames: () => products.systemFilterNames,
getBreadcrumbs: (state, getters) => getters.getBreadcrumbsFor(getters.getCurrentCategory),
getBreadcrumbsFor: (state, getters) => category => {
if (!category) return []
Expand Down
6 changes: 6 additions & 0 deletions docs/guide/basics/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@ This is the `vue-storefront-api` endpoint for rendering product lists.

Here, we have the sort field settings as they're displayed on the Category page.

```json
"systemFilterNames": ["sort"],
```

This is an array of query-fields which won't be treated as filter fields when in URL.

```json
"gallery": {
"mergeConfigurableChildren": true
Expand Down
1 change: 1 addition & 0 deletions docs/guide/cookbook/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ At [`vue-storefront/config/default.json`](https://github.com/DivanteLtd/vue-stor
"setupVariantByAttributeCode": true,
"endpoint": "http://localhost:8080/api/product",
"defaultFilters": ["color", "size", "price", "erin_recommends"],
"systemFilterNames": ["sort"],
"filterFieldMapping": {
"category.name": "category.name.keyword"
},
Expand Down