diff --git a/components/core/CookieNotification.vue b/components/core/CookieNotification.vue index 2716d39..68ad22f 100644 --- a/components/core/CookieNotification.vue +++ b/components/core/CookieNotification.vue @@ -57,14 +57,14 @@ export default { this.isOpen = false }, setVisited () { - this.$store.dispatch('claims/set', {claimCode: 'cookiesAccepted', value: true}) + this.$store.dispatch('claims/set', { claimCode: 'cookiesAccepted', value: true }) } }, mounted () { - this.$store.dispatch('claims/check', {claimCode: 'cookiesAccepted'}).then((cookieClaim) => { + this.$store.dispatch('claims/check', { claimCode: 'cookiesAccepted' }).then((cookieClaim) => { if (!cookieClaim) { this.isOpen = true - this.$store.dispatch('claims/set', {claimCode: 'cookiesAccepted', value: false}) + this.$store.dispatch('claims/set', { claimCode: 'cookiesAccepted', value: false }) } else { this.isOpen = !cookieClaim.value } diff --git a/components/core/ProductBundleOption.vue b/components/core/ProductBundleOption.vue index 51bd8f8..1cf85d7 100644 --- a/components/core/ProductBundleOption.vue +++ b/components/core/ProductBundleOption.vue @@ -1,7 +1,7 @@ diff --git a/pages/MyAccount.vue b/pages/MyAccount.vue index ce7a595..588752e 100644 --- a/pages/MyAccount.vue +++ b/pages/MyAccount.vue @@ -46,8 +46,8 @@ import MyOrders from '../components/core/blocks/MyAccount/MyOrders' import MyOrder from '../components/core/blocks/MyAccount/MyOrder' import MyRecentlyViewed from '../components/core/blocks/MyAccount/MyRecentlyViewed' import NoSSR from 'vue-no-ssr' -import {RecentlyViewedModule} from '@vue-storefront/core/modules/recently-viewed' -import {registerModule} from '@vue-storefront/core/lib/modules' +import { RecentlyViewedModule } from '@vue-storefront/core/modules/recently-viewed' +import { registerModule } from '@vue-storefront/core/lib/modules' export default { data () { diff --git a/pages/Product.vue b/pages/Product.vue index 872cfe9..2dbd275 100644 --- a/pages/Product.vue +++ b/pages/Product.vue @@ -163,8 +163,8 @@ @@ -222,6 +222,7 @@ import { onlineHelper, isServer, productJsonLd } from '@vue-storefront/core/help import { catalogHooksExecutors } from '@vue-storefront/core/modules/catalog-next/hooks' import ProductPrice from 'theme/components/core/ProductPrice.vue' import { doPlatformPricesSync } from '@vue-storefront/core/modules/catalog/helpers' +import { filterChangedProduct } from '@vue-storefront/core/modules/catalog/events' export default { components: { @@ -268,7 +269,6 @@ export default { getCurrentProduct: 'product/getCurrentProduct', getProductGallery: 'product/getProductGallery', getCurrentProductConfiguration: 'product/getCurrentProductConfiguration', - getOriginalProduct: 'product/getOriginalProduct', attributesByCode: 'attribute/attributeListByCode', getCurrentCustomOptions: 'product/getCurrentCustomOptions' }), @@ -331,7 +331,8 @@ export default { async mounted () { await this.$store.dispatch('recently-viewed/addItem', this.getCurrentProduct) }, - async asyncData ({ store, route }) { + async asyncData ({ store, route, context }) { + if (context) context.output.cacheTags.add('product') const product = await store.dispatch('product/loadProduct', { parentSku: route.params.parentSku, childSku: route && route.params && route.params.childSku ? route.params.childSku : null }) const loadBreadcrumbsPromise = store.dispatch('product/loadProductBreadcrumbs', { product }) if (isServer) await loadBreadcrumbsPromise @@ -378,11 +379,9 @@ export default { action1: { label: this.$t('OK') } }) }, - changeFilter (variant) { - this.$bus.$emit( - 'filter-changed-product', - Object.assign({ attribute_code: variant.type }, variant) - ) + async changeFilter (variant) { + const selectedConfiguration = Object.assign({ attribute_code: variant.type }, variant) + await filterChangedProduct(selectedConfiguration, this.$store, this.$router) this.getQuantity() }, openSizeGuide () { diff --git a/pages/Static.vue b/pages/Static.vue index c681ee8..f926699 100644 --- a/pages/Static.vue +++ b/pages/Static.vue @@ -45,7 +45,7 @@ export default { metaInfo () { return { title: this.$route.meta.title || this.$props.title, - meta: this.$route.meta.description ? [{vmid: 'description', description: this.$route.meta.description}] : [] + meta: this.$route.meta.description ? [{ vmid: 'description', description: this.$route.meta.description }] : [] } }, props: { diff --git a/resource/i18n/ar-SY.csv b/resource/i18n/ar-SY.csv index 63c51ef..6f1937e 100644 --- a/resource/i18n/ar-SY.csv +++ b/resource/i18n/ar-SY.csv @@ -1,4 +1,5 @@ "About us","من نحن" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","أدخل رمز الخصم" "Add discount code","إرسال" "Add to cart","أضف إلى السلّة" diff --git a/resource/i18n/cs-CZ.csv b/resource/i18n/cs-CZ.csv index 1ba94eb..36fa339 100644 --- a/resource/i18n/cs-CZ.csv +++ b/resource/i18n/cs-CZ.csv @@ -1,4 +1,5 @@ "About us","O nás" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Přidejte kód pro slevu" "Add discount code","Použít" "Add to cart","Přidat do košíku" diff --git a/resource/i18n/de-DE.csv b/resource/i18n/de-DE.csv index a910543..4cd3a4c 100644 --- a/resource/i18n/de-DE.csv +++ b/resource/i18n/de-DE.csv @@ -1,5 +1,6 @@ "About us (Magento CMS)","Über uns (Magento CMS)" "About us","Über uns" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Einen Rabatt-Code hinzufügen" "Add discount code","Rabatt-Code hinzufügen" "Add to cart","In den Warenkorb" diff --git a/resource/i18n/en-US.csv b/resource/i18n/en-US.csv index e0cf8a4..eb42fa3 100644 --- a/resource/i18n/en-US.csv +++ b/resource/i18n/en-US.csv @@ -1,6 +1,7 @@ "A customer with the same email already exists in an associated website.","A customer with the same email already exists in an associated website." "About us (Magento CMS)","About us (Magento CMS)" "About us","About us" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Add a discount code" "Add discount code","Apply" "Add to cart","Add to cart" @@ -165,6 +166,7 @@ "Product Name","Product Name" "Product details","Product details" "Products","Products" +"Provided email does not exist","Provided email does not exist" "Purchase","Purchase" "Qty","Qty" "Quantity","Quantity" @@ -293,4 +295,3 @@ "to find product you were looking for.","to find product you were looking for." "to find something beautiful for You!","to find something beautiful for You!" "{count} items","{count} items" -"Provided email does not exist","Provided email does not exist" \ No newline at end of file diff --git a/resource/i18n/es-ES.csv b/resource/i18n/es-ES.csv index af2bfcf..2a16725 100644 --- a/resource/i18n/es-ES.csv +++ b/resource/i18n/es-ES.csv @@ -1,4 +1,5 @@ "About us","Sobre nosotros" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add to cart","Añadir a la cesta" "Add to compare","Añadir a comparar" "Add to favorite","Agregar a Favoritos" diff --git a/resource/i18n/et-EE.csv b/resource/i18n/et-EE.csv index b28b020..9b0815d 100644 --- a/resource/i18n/et-EE.csv +++ b/resource/i18n/et-EE.csv @@ -1,6 +1,7 @@ "A customer with the same email already exists in an associated website.","Sama e-postiga klient juba eksisteerib." "About us (Magento CMS)","About us (Magento CMS)" "About us",Meist +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Lisa sooduskood" "Add discount code","Lisa sooduskood" "Add to cart",Osta diff --git a/resource/i18n/fi-FI.csv b/resource/i18n/fi-FI.csv index 2f39b11..ef5f15f 100644 --- a/resource/i18n/fi-FI.csv +++ b/resource/i18n/fi-FI.csv @@ -1,6 +1,7 @@ "A customer with the same email already exists in an associated website.","Samalla sähköpostiosoitteella on jo asiakas samalla sivustolla." "About us (Magento CMS)","Tietoja verkkokaupasta (Magento CMS)" "About us","Tietoja verkkokaupasta" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Lisää alennuskoodi" "Add discount code","Lisää alennuskoodi" "Add to cart","Lisää koriin" diff --git a/resource/i18n/fr-FR.csv b/resource/i18n/fr-FR.csv index 40c8d3c..b76872f 100644 --- a/resource/i18n/fr-FR.csv +++ b/resource/i18n/fr-FR.csv @@ -1,4 +1,5 @@ "About us","À propos" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Ajouter un code de réduction" "Add discount code","Appliquer" "Add to cart","Ajouter au panier" diff --git a/resource/i18n/it-IT.csv b/resource/i18n/it-IT.csv index a8f86e7..971ed4c 100644 --- a/resource/i18n/it-IT.csv +++ b/resource/i18n/it-IT.csv @@ -1,6 +1,7 @@ "A customer with the same email already exists in an associated website.","Esiste già un account registrato con questo indirizzo email." "About us (Magento CMS)","Chi siamo (Magento CMS)" "About us","Chi siamo" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Aggiungi un codice sconto" "Add discount code","Applica" "Add to cart","Aggiungi al carrello" diff --git a/resource/i18n/ja-JP.csv b/resource/i18n/ja-JP.csv index d42b00e..e2fa669 100644 --- a/resource/i18n/ja-JP.csv +++ b/resource/i18n/ja-JP.csv @@ -1,4 +1,5 @@ "About us","About us" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","ディスカウントコードを追加する" "Add discount code","申し込み" "Add to cart","カートに追加" diff --git a/resource/i18n/nl-NL.csv b/resource/i18n/nl-NL.csv index 8d09859..1bce6a7 100644 --- a/resource/i18n/nl-NL.csv +++ b/resource/i18n/nl-NL.csv @@ -1,3 +1,4 @@ +"Accepts only alphabet characters.","Accepts only alphabet characters." "Please change Your search criteria and try again. If still not finding anything relevant, please visit the Home page and try out some of our bestsellers!","Pas uw zoekcriteria aan en probeer het opnieuw. Als u nog steeds niks relevants kan vinden, bezoek dan de homepage en bekijk onze bestsellers!" "Select ","Selecteer " "You are offline. Some features might not be available.","U bent momenteel offline, niet alle onderdelen van de shop zullen volledig werken" diff --git a/resource/i18n/pl-PL.csv b/resource/i18n/pl-PL.csv index 8f10161..8d0189d 100644 --- a/resource/i18n/pl-PL.csv +++ b/resource/i18n/pl-PL.csv @@ -1,4 +1,5 @@ "About us","O nas" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Dodaj kod rabatowy" "Add discount code","Dodaj kod rabatowy" "Add to cart","Dodaj do koszyka" diff --git a/resource/i18n/pt-BR.csv b/resource/i18n/pt-BR.csv index fe2164c..d373ec4 100644 --- a/resource/i18n/pt-BR.csv +++ b/resource/i18n/pt-BR.csv @@ -1,4 +1,5 @@ "About us","Sobre nós" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Adicionar cupom de desconto" "Add discount code","Aplicar" "Add to cart","Adicionar ao carrinho" diff --git a/resource/i18n/ru-RU.csv b/resource/i18n/ru-RU.csv index 060ba2f..fad6daf 100644 --- a/resource/i18n/ru-RU.csv +++ b/resource/i18n/ru-RU.csv @@ -1,4 +1,5 @@ "About us","О нас" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","Ввести скидочный код" "Add discount code","Применить" "Add to cart","Добавить в корзину" diff --git a/resource/i18n/zh-cn.csv b/resource/i18n/zh-cn.csv index 176ecce..7c4e7b6 100644 --- a/resource/i18n/zh-cn.csv +++ b/resource/i18n/zh-cn.csv @@ -1,5 +1,6 @@ "About us (Magento CMS)","关于我们(Magento CMS)" "About us","关于我们" +"Accepts only alphabet characters.","Accepts only alphabet characters." "Add a discount code","A添加折扣代码" "Add to cart","加入购物车" "Add to compare","商品比较" diff --git a/router/index.js b/router/index.js index 7e1eec9..4129624 100644 --- a/router/index.js +++ b/router/index.js @@ -13,27 +13,27 @@ const ResetPassword = () => import(/* webpackChunkName: "vsf-reset-password" */ let routes = [ { name: 'home', path: '/', component: Home, alias: '/pwa.html' }, { name: 'checkout', path: '/checkout', component: Checkout }, - { name: 'legal', path: '/legal', component: Static, props: {page: 'lorem', title: 'Legal Notice'}, meta: {title: 'Legal Notice', description: 'Legal Notice - example of description usage'} }, - { name: 'privacy', path: '/privacy', component: Static, props: {page: 'lorem', title: 'Privacy'} }, - { name: 'magazine', path: '/magazine', component: Static, props: {page: 'lorem', title: 'Magazine'} }, - { name: 'sale', path: '/sale', component: Static, props: {page: 'lorem', title: 'Sale'} }, - { name: 'order-tracking', path: '/order-tracking', component: Static, props: {page: 'lorem', title: 'Track my Order'} }, + { name: 'legal', path: '/legal', component: Static, props: { page: 'lorem', title: 'Legal Notice' }, meta: { title: 'Legal Notice', description: 'Legal Notice - example of description usage' } }, + { name: 'privacy', path: '/privacy', component: Static, props: { page: 'lorem', title: 'Privacy' } }, + { name: 'magazine', path: '/magazine', component: Static, props: { page: 'lorem', title: 'Magazine' } }, + { name: 'sale', path: '/sale', component: Static, props: { page: 'lorem', title: 'Sale' } }, + { name: 'order-tracking', path: '/order-tracking', component: Static, props: { page: 'lorem', title: 'Track my Order' } }, { name: 'my-account', path: '/my-account', component: MyAccount }, { name: 'my-shipping-details', path: '/my-account/shipping-details', component: MyAccount, props: { activeBlock: 'MyShippingDetails' } }, { name: 'my-newsletter', path: '/my-account/newsletter', component: MyAccount, props: { activeBlock: 'MyNewsletter' } }, { name: 'my-orders', path: '/my-account/orders', component: MyAccount, props: { activeBlock: 'MyOrders' } }, { name: 'my-order', path: '/my-account/orders/:orderId', component: MyAccount, props: { activeBlock: 'MyOrder' } }, { name: 'my-recently-viewed', path: '/my-account/recently-viewed', component: MyAccount, props: { activeBlock: 'MyRecentlyViewed' } }, - { name: 'about-us', path: '/about-us', component: Static, props: {page: 'lorem', title: 'About us'} }, - { name: 'customer-service', path: '/customer-service', component: Static, props: {page: 'lorem', title: 'Customer service'} }, - { name: 'store-locator', path: '/store-locator', component: Static, props: {page: 'lorem', title: 'Store locator'} }, - { name: 'size-guide', path: '/size-guide', component: Static, props: {page: 'lorem', title: 'Size guide'} }, - { name: 'gift-card', path: '/gift-card', component: Static, props: {page: 'lorem', title: 'Gift card'} }, - { name: 'delivery', path: '/delivery', component: Static, props: {page: 'lorem', title: 'Delivery'} }, - { name: 'returns', path: '/returns', component: Static, props: {page: 'lorem', title: 'Returns policy'} }, - { name: 'order-from-catalog', path: '/order-from-catalog', component: Static, props: {page: 'lorem', title: 'Order from catalog'} }, - { name: 'contact', path: '/contact', component: Static, props: {page: 'contact', title: 'Contact'} }, - { name: 'compare', path: '/compare', component: Compare, props: {title: 'Compare Products'} }, + { name: 'about-us', path: '/about-us', component: Static, props: { page: 'lorem', title: 'About us' } }, + { name: 'customer-service', path: '/customer-service', component: Static, props: { page: 'lorem', title: 'Customer service' } }, + { name: 'store-locator', path: '/store-locator', component: Static, props: { page: 'lorem', title: 'Store locator' } }, + { name: 'size-guide', path: '/size-guide', component: Static, props: { page: 'lorem', title: 'Size guide' } }, + { name: 'gift-card', path: '/gift-card', component: Static, props: { page: 'lorem', title: 'Gift card' } }, + { name: 'delivery', path: '/delivery', component: Static, props: { page: 'lorem', title: 'Delivery' } }, + { name: 'returns', path: '/returns', component: Static, props: { page: 'lorem', title: 'Returns policy' } }, + { name: 'order-from-catalog', path: '/order-from-catalog', component: Static, props: { page: 'lorem', title: 'Order from catalog' } }, + { name: 'contact', path: '/contact', component: Static, props: { page: 'contact', title: 'Contact' } }, + { name: 'compare', path: '/compare', component: Compare, props: { title: 'Compare Products' } }, { name: 'error', path: '/error', component: ErrorPage, meta: { layout: 'minimal' } }, { name: 'virtual-product', path: '/p/:parentSku/:slug', component: Product }, // :sku param can be marked as optional with ":sku?" (https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js#L16), but it requires a lot of work to adjust the rest of the site { name: 'bundle-product', path: '/p/:parentSku/:slug', component: Product }, // :sku param can be marked as optional with ":sku?" (https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js#L16), but it requires a lot of work to adjust the rest of the site diff --git a/store/homepage.ts b/store/homepage.ts index 5607cec..eab0a29 100644 --- a/store/homepage.ts +++ b/store/homepage.ts @@ -10,25 +10,30 @@ export const homepageStore = { async fetchNewCollection ({ commit, dispatch }) { const newProductsQuery = prepareQuery({ queryConfig: 'newProducts' }) - const newProductsResult = await dispatch('product/list', { + const { items } = await dispatch('product/findProducts', { query: newProductsQuery, size: 8, - sort: 'created_at:desc' + sort: 'created_at:desc', + options: { + populateRequestCacheTags: true, + prefetchGroupProducts: false + } }, { root: true }) - const configuredProducts = await dispatch( - 'category-next/configureProducts', - { products: newProductsResult.items - }, { root: true }) - commit('SET_NEW_COLLECTION', configuredProducts) + + commit('SET_NEW_COLLECTION', items) }, async loadBestsellers ({ commit, dispatch }) { - const response = await dispatch('product/list', { + const { items } = await dispatch('product/findProducts', { query: prepareQuery({ queryConfig: 'bestSellers' }), size: 8, - sort: 'created_at:desc' + sort: 'created_at:desc', + options: { + populateRequestCacheTags: true, + prefetchGroupProducts: false + } }, { root: true }) - commit('SET_BESTSELLERS', response.items) + commit('SET_BESTSELLERS', items) } }, mutations: { diff --git a/store/promoted-offers.ts b/store/promoted-offers.ts index a118f9b..c83bba6 100644 --- a/store/promoted-offers.ts +++ b/store/promoted-offers.ts @@ -26,7 +26,7 @@ export const promotedStore = { getHeadImage: state => state.headImage }, actions: { - async updatePromotedOffers ({commit, rootState}, data) { + async updatePromotedOffers ({ commit, rootState }, data) { let promotedBannersResource = rootState.storeView && rootState.storeView.storeCode ? `banners/${rootState.storeView.storeCode}_promoted_offers` : `promoted_offers` try { // Workaround to get jest --watch to work so don't change the import sting to a template string @@ -36,7 +36,7 @@ export const promotedStore = { Logger.debug('Unable to load promotedOffers' + err)() } }, - async updateHeadImage ({commit, rootState}, data) { + async updateHeadImage ({ commit, rootState }, data) { let mainImageResource = rootState.storeView && rootState.storeView.storeCode ? `banners/${rootState.storeView.storeCode}_main-image` : `main-image` try { // Workaround to get jest --watch to work so don't change the import sting to a template string diff --git a/store/ui.ts b/store/ui.ts index e1a6f8c..a92769c 100644 --- a/store/ui.ts +++ b/store/ui.ts @@ -62,6 +62,12 @@ export const uiStore = { }, toggleWishlist ({ commit, state }) { commit('setWishlist', !state.wishlist) + }, + closeMicrocart ({ commit, state }) { + if (state.microcart) commit('setMicrocart', false) + }, + closeWishlist ({ commit, state }) { + if (state.wishlist) commit('setWishlist', false) } } }