diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e8b661069..9fb6376f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add unit tests for `core/modules/user` - @dz3n (#3470) - Add to cart from Wishlist and Product listing for simple products - @Dnd-Dboy, @dz3n (#2637) - Add global Category and Breadcrumb filters, defined in local.json - @grimasod (#3691) +- Add constant which conditions the number of products loading per page - @AdKamil (#3630) ### Fixed - Fixed problem with cutting image height in category page on 1024px+ screen res - @AdKamil (#3781) diff --git a/src/themes/default/pages/Category.vue b/src/themes/default/pages/Category.vue index b6533dd018..8182d3366a 100644 --- a/src/themes/default/pages/Category.vue +++ b/src/themes/default/pages/Category.vue @@ -95,13 +95,16 @@ import { catalogHooksExecutors } from '@vue-storefront/core/modules/catalog-next import { localizedRoute, currentStoreView } from '@vue-storefront/core/lib/multistore' import { htmlDecode } from '@vue-storefront/core/filters' +const THEME_PAGE_SIZE = 50 + const composeInitialPageState = async (store, route, forceLoad = false) => { try { const filters = getSearchOptionsFromRouteParams(route.params) const cachedCategory = store.getters['category-next/getCategoryFrom'](route.path) const currentCategory = cachedCategory && !forceLoad ? cachedCategory : await store.dispatch('category-next/loadCategory', { filters }) - await store.dispatch('category-next/loadCategoryProducts', {route, category: currentCategory}) + await store.dispatch('category-next/loadCategoryProducts', {route, category: currentCategory, pageSize: THEME_PAGE_SIZE}) const breadCrumbsLoader = store.dispatch('category-next/loadCategoryBreadcrumbs', { category: currentCategory, currentRouteName: currentCategory.name, omitCurrent: true }) + if (isServer) await breadCrumbsLoader catalogHooksExecutors.categoryPageVisited(currentCategory) } catch (e) {