diff --git a/packages/core/docs/core/changelog/6356.js b/packages/core/docs/core/changelog/6356.js new file mode 100644 index 0000000000..e60efe13ba --- /dev/null +++ b/packages/core/docs/core/changelog/6356.js @@ -0,0 +1,8 @@ +module.exports = { + description: 'Fixed adding items to cart from list view in category page', + link: 'https://github.com/vuestorefront/vue-storefront/pull/6356', + isBreaking: false, + breakingChanges: [], + author: 'Dawid Ziobro', + linkToGitHubAccount: 'https://github.com/dawid-ziobro' +}; diff --git a/packages/core/nuxt-theme-module/theme/pages/Category.vue b/packages/core/nuxt-theme-module/theme/pages/Category.vue index 6b43643f1f..243eaed0cf 100644 --- a/packages/core/nuxt-theme-module/theme/pages/Category.vue +++ b/packages/core/nuxt-theme-module/theme/pages/Category.vue @@ -211,7 +211,7 @@ import { SfColor, SfProperty } from '@storefront-ui/vue'; -import { computed } from '@vue/composition-api'; +import { computed, ref } from '@vue/composition-api'; import { useCart, useWishlist, productGetters, useFacet, facetGetters } from '<%= options.generate.replace.composables %>'; import { useUiHelpers, useUiState } from '~/composables'; import { onSSR } from '@vue-storefront/core'; @@ -233,6 +233,7 @@ export default { const { addItem: addItemToWishlist, isInWishlist, removeItem: removeItemFromWishlist } = useWishlist(); const { result, search, loading, error } = useFacet(); + const productsQuantity = ref({}); const products = computed(() => facetGetters.getProducts(result.value)); const categoryTree = computed(() => facetGetters.getCategoryTree(result.value)); const breadcrumbs = computed(() => facetGetters.getBreadcrumbs(result.value)); @@ -268,7 +269,8 @@ export default { removeItemFromWishlist, isInWishlist, addItemToCart, - isInCart + isInCart, + productsQuantity }; }, components: {