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 @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed `cart/isVirtualCart` to return `false` when cart is empty - @haelbichalex(#4182)
- Use `setProductGallery` in `product/setCurrent` to use logic of the action - @cewald (#4153)
- Use same data format in getConfigurationMatchLevel - @gibkigonzo (#4208)
- removed possible memory leak in ssr - @resubaka (#4247)

### Changed / Improved

Expand Down
16 changes: 7 additions & 9 deletions src/modules/instant-checkout/components/InstantCheckout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { currentStoreView } from '@vue-storefront/core/lib/multistore'
import { registerModule } from '@vue-storefront/core/lib/modules'
import { OrderModule } from '@vue-storefront/core/modules/order'

const storeView = currentStoreView()

export default {
name: 'InstantCheckoutButton',
beforeCreate () {
Expand All @@ -25,7 +23,7 @@ export default {
data () {
return {
supported: false,
country: rootStore.state.checkout.shippingDetails.country ? rootStore.state.checkout.shippingDetails.country : storeView.tax.defaultCountry,
country: rootStore.state.checkout.shippingDetails.country ? rootStore.state.checkout.shippingDetails.country : currentStoreView().tax.defaultCountry,
paymentMethods: [
{
supportedMethods: ['basic-card'],
Expand Down Expand Up @@ -56,7 +54,7 @@ export default {
bucket.push({
label: product.name,
amount: {
currency: storeView.i18n.currencyCode,
currency: currentStoreView().i18n.currencyCode,
value: this.getProductPrice(product)
}
})
Expand All @@ -67,7 +65,7 @@ export default {
if (this.selectedShippingOption.length > 0) {
bucket.push({
label: i18n.t('Shipping'),
amount: { currency: storeView.i18n.currencyCode, value: this.selectedShippingOption[0].amount.value }
amount: { currency: currentStoreView().i18n.currencyCode, value: this.selectedShippingOption[0].amount.value }
})
}

Expand All @@ -81,7 +79,7 @@ export default {
if (shipping.length > 0) {
bucket.push({
label: shipping[0].title,
amount: { currency: storeView.i18n.currencyCode, value: shipping[0].value }
amount: { currency: currentStoreView().i18n.currencyCode, value: shipping[0].value }
})
}

Expand All @@ -107,7 +105,7 @@ export default {

return {
label: i18n.t('Grand total'),
amount: { currency: storeView.i18n.currencyCode, value: subtotal }
amount: { currency: currentStoreView().i18n.currencyCode, value: subtotal }
}
}

Expand All @@ -118,7 +116,7 @@ export default {
if (total.length > 0) {
return {
label: total[0].title,
amount: { currency: storeView.i18n.currencyCode, value: total[0].value }
amount: { currency: currentStoreView().i18n.currencyCode, value: total[0].value }
}
}

Expand Down Expand Up @@ -231,7 +229,7 @@ export default {
label: method.method_title,
selected: setDefault ? this.$store.getters['checkout/getShippingMethods'][0].method_code === method.method_code : false,
amount: {
currency: storeView.i18n.currencyCode,
currency: currentStoreView().i18n.currencyCode,
value: method.price_incl_tax
}
})
Expand Down