From 22e3c15d7e160517c6e9a67f034f29fbb17c4855 Mon Sep 17 00:00:00 2001 From: pkarw Date: Tue, 28 Aug 2018 13:43:51 +0800 Subject: [PATCH 1/2] Fix for status and visibility in product blocks on Home page --- .../default/components/theme/blocks/Collection/Collection.vue | 2 +- src/themes/default/pages/Home.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/themes/default/components/theme/blocks/Collection/Collection.vue b/src/themes/default/components/theme/blocks/Collection/Collection.vue index 5ec9014fc0..0ac76f67fb 100644 --- a/src/themes/default/components/theme/blocks/Collection/Collection.vue +++ b/src/themes/default/components/theme/blocks/Collection/Collection.vue @@ -45,7 +45,7 @@ export default { } }, beforeMount () { - let inspirationsQuery = builder().query('match', 'category.name', this.category).build() + let inspirationsQuery = builder().query('match', 'category.name', this.category).andQuery('range', 'status', { 'gte': 0, 'lt': 2 }).andQuery('range', 'visibility', { 'gte': 2, 'lte': 4 }/** Magento visibility in search & categories */).build() this.$store.dispatch('product/list', { query: inspirationsQuery, diff --git a/src/themes/default/pages/Home.vue b/src/themes/default/pages/Home.vue index 5cd23e9409..dec026ce4a 100755 --- a/src/themes/default/pages/Home.vue +++ b/src/themes/default/pages/Home.vue @@ -88,8 +88,8 @@ export default { asyncData ({ store, route }) { // this is for SSR purposes to prefetch data return new Promise((resolve, reject) => { console.log('Entering asyncData for Home ' + new Date()) - let newProductsQuery = builder().query('match', 'category.name', 'Tees').andFilter('range', 'visibility', { 'gte': 2, 'lte': 4 }/** Magento visibility in search & categories */).build() - let coolBagsQuery = builder().query('match', 'category.name', 'Women').andFilter('range', 'visibility', { 'gte': 2, 'lte': 4 }/** Magento visibility in search & categories */).build() + let newProductsQuery = builder().query('match', 'category.name', 'Tees').andQuery('range', 'status', { 'gte': 0, 'lt': 2 }).andQuery('range', 'visibility', { 'gte': 2, 'lte': 4 }/** Magento visibility in search & categories */).build() + let coolBagsQuery = builder().query('match', 'category.name', 'Women').andQuery('range', 'status', { 'gte': 0, 'lt': 2 }).andQuery('range', 'visibility', { 'gte': 2, 'lte': 4 }/** Magento visibility in search & categories */).build() store.dispatch('category/list', { includeFields: config.entities.optimize ? config.entities.category.includeFields : null }).then((categories) => { store.dispatch('product/list', { query: newProductsQuery, From d2dae43c72a9ad8a38e1f20703c76a7aa6989459 Mon Sep 17 00:00:00 2001 From: pkarw Date: Tue, 28 Aug 2018 14:10:05 +0800 Subject: [PATCH 2/2] Fix for shipping methods change (org. PR: #1523) --- core/components/blocks/Checkout/Shipping.js | 1 + core/pages/Checkout.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/components/blocks/Checkout/Shipping.js b/core/components/blocks/Checkout/Shipping.js index 36a1bf018b..e3c5f174ae 100644 --- a/core/components/blocks/Checkout/Shipping.js +++ b/core/components/blocks/Checkout/Shipping.js @@ -55,6 +55,7 @@ export default { } this.shipping.shippingMethod = shipping.method_code } + this.changeShippingMethod() }, methods: { sendDataToCheckout () { diff --git a/core/pages/Checkout.js b/core/pages/Checkout.js index d924ad7b2c..922d9fda5c 100644 --- a/core/pages/Checkout.js +++ b/core/pages/Checkout.js @@ -313,8 +313,8 @@ export default { region_code: this.payment.region_code ? this.payment.region_code : '', vat_id: this.payment.taxId }, - shipping_method_code: this.shippingMethod.method_code ? this.shippingMethod.method_code : this.shipping.method_code, - shipping_carrier_code: this.shippingMethod.carrier_code ? this.shippingMethod.carrier_code : this.shipping.method_code, + shipping_method_code: this.shippingMethod.method_code ? this.shippingMethod.method_code : this.shipping.shippingMethod, + shipping_carrier_code: this.shippingMethod.carrier_code ? this.shippingMethod.carrier_code : this.shipping.shippingMethod, payment_method_code: this.getPaymentMethod(), payment_method_additional: this.payment.paymentMethodAdditional, shippingExtraFields: this.shipping.extraFields