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 @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion src/themes/default/pages/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down