diff --git a/packages/theme/components/AppHeader.vue b/packages/theme/components/AppHeader.vue index 362ee5f32..0c279e337 100644 --- a/packages/theme/components/AppHeader.vue +++ b/packages/theme/components/AppHeader.vue @@ -121,16 +121,15 @@ import { useCart, useUiHelpers, useUiState, - useWishlist, } from '~/composables'; +import useWishlist from '~/modules/wishlist/composables/useWishlist'; import { useUser } from '~/modules/customer/composables/useUser'; - +import { useWishlistStore } from '~/modules/wishlist/store/wishlistStore'; import type { CategoryTree } from '~/modules/GraphQL/types'; import CurrencySelector from '~/components/CurrencySelector.vue'; import HeaderLogo from '~/components/HeaderLogo.vue'; import SvgImage from '~/components/General/SvgImage.vue'; import StoreSwitcher from '~/components/StoreSwitcher.vue'; -import { useCustomerStore } from '~/stores/customer'; export default defineComponent({ components: { @@ -158,10 +157,10 @@ export default defineComponent({ const { loadItemsCount: loadWishlistItemsCount } = useWishlist(); const { categories: categoryList, load: categoriesListLoad } = useCategory(); - const customerStore = useCustomerStore(); + const wishlistStore = useWishlistStore(); const isSearchOpen = ref(false); const result = ref(null); - const wishlistItemsQty = computed(() => customerStore.wishlist?.items_count ?? 0); + const wishlistItemsQty = computed(() => wishlistStore.wishlist?.items_count ?? 0); const wishlistHasProducts = computed(() => wishlistItemsQty.value > 0); const accountIcon = computed(() => (isAuthenticated.value ? 'profile_fill' : 'profile')); diff --git a/packages/theme/components/Header/SearchBar/SearchResults.vue b/packages/theme/components/Header/SearchBar/SearchResults.vue index 2a94dbe80..212fb4a3b 100644 --- a/packages/theme/components/Header/SearchBar/SearchResults.vue +++ b/packages/theme/components/Header/SearchBar/SearchResults.vue @@ -157,8 +157,9 @@ import { import { ref, computed, defineComponent } from '@nuxtjs/composition-api'; import productGetters from '~/modules/catalog/product/getters/productGetters'; import { - useUiHelpers, useImage, useWishlist, + useUiHelpers, useImage, } from '~/composables'; +import useWishlist from '~/modules/wishlist/composables/useWishlist'; import { useUser } from '~/modules/customer/composables/useUser'; import SvgImage from '~/components/General/SvgImage.vue'; diff --git a/packages/theme/components/LoginModal.vue b/packages/theme/components/LoginModal.vue index 53fee5651..3b0f6a2b8 100644 --- a/packages/theme/components/LoginModal.vue +++ b/packages/theme/components/LoginModal.vue @@ -299,8 +299,9 @@ import { import { ValidationProvider, ValidationObserver, extend } from 'vee-validate'; import { required, email } from 'vee-validate/dist/rules'; import { - useUiState, useWishlist, useForgotPassword, useCart, + useUiState, useForgotPassword, useCart, } from '~/composables'; +import useWishlist from '~/modules/wishlist/composables/useWishlist'; import { useUser } from '~/modules/customer/composables/useUser'; import { customerPasswordRegExp, invalidPasswordMsg } from '~/modules/customer/helpers/passwordValidation'; diff --git a/packages/theme/components/NewProducts.vue b/packages/theme/components/NewProducts.vue index 862812e83..76158edf3 100644 --- a/packages/theme/components/NewProducts.vue +++ b/packages/theme/components/NewProducts.vue @@ -65,8 +65,9 @@ import { computed, defineComponent, onMounted, ref, } from '@nuxtjs/composition-api'; import { - useImage, useProduct, useWishlist, + useImage, useProduct, } from '~/composables'; +import useWishlist from '~/modules/wishlist/composables/useWishlist'; import productGetters from '~/modules/catalog/product/getters/productGetters'; import { useUser } from '~/modules/customer/composables/useUser'; import { useAddToCart } from '~/helpers/cart/addToCart'; diff --git a/packages/theme/composables/index.ts b/packages/theme/composables/index.ts index f5fc1d761..859f6c7e5 100644 --- a/packages/theme/composables/index.ts +++ b/packages/theme/composables/index.ts @@ -40,7 +40,7 @@ export * from './useUrlResolver'; export * from '~/modules/customer/composables/useUser'; export * from '~/modules/customer/composables/useUserAddress'; export * from '~/modules/customer/composables/useUserOrder'; -export * from '~/modules/customer/composables/useWishlist'; +export * from '~/modules/wishlist/composables/useWishlist'; export * from './useMagentoConfiguration'; export * from './types'; diff --git a/packages/theme/composables/useCart/useCart.ts b/packages/theme/composables/useCart/useCart.ts index faa8db770..908bc924c 100644 --- a/packages/theme/composables/useCart/useCart.ts +++ b/packages/theme/composables/useCart/useCart.ts @@ -51,7 +51,7 @@ type UseCartIsInCartParams = { */ export interface UseCartInterface { /** Loads the current cart */ - load(params: ComposableFunctionArgs<{ realCart?: boolean }>): Promise; + load(params?: ComposableFunctionArgs<{ realCart?: boolean }>): Promise; /** Updates the global application state with the current total quantity of the cart */ loadTotalQty(): Promise; /** Takes in a `product` and its `quantity` and adds it to the cart */ diff --git a/packages/theme/layouts/default.vue b/packages/theme/layouts/default.vue index 76b02afa3..b35093aca 100644 --- a/packages/theme/layouts/default.vue +++ b/packages/theme/layouts/default.vue @@ -18,15 +18,15 @@ -