From b3ab687cb4d7a42dc1ab512e219c783ec4af2f6f Mon Sep 17 00:00:00 2001 From: Dmitry Schegolikhin Date: Sun, 19 May 2019 00:23:15 +0400 Subject: [PATCH 1/2] [2730] Fixed working of checkboxes in checkout --- core/modules/checkout/components/Payment.ts | 10 ++++++++++ core/modules/checkout/components/Shipping.ts | 7 +++++++ core/modules/user/components/UserShippingDetails.ts | 7 +++++++ .../components/core/blocks/Checkout/Payment.vue | 1 - .../components/core/blocks/Checkout/Shipping.vue | 1 - .../core/blocks/MyAccount/MyShippingDetails.vue | 1 - 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/modules/checkout/components/Payment.ts b/core/modules/checkout/components/Payment.ts index d0eccdd81b..b36850ee70 100644 --- a/core/modules/checkout/components/Payment.ts +++ b/core/modules/checkout/components/Payment.ts @@ -59,6 +59,16 @@ export const Payment = { handler () { this.useShippingAddress() } + }, + sendToBillingAddress: { + handler () { + this.useBillingAddress() + } + }, + generateInvoice: { + handler () { + this.useGenerateInvoice() + } } }, methods: { diff --git a/core/modules/checkout/components/Shipping.ts b/core/modules/checkout/components/Shipping.ts index 30ca34a8ab..05902373d6 100644 --- a/core/modules/checkout/components/Shipping.ts +++ b/core/modules/checkout/components/Shipping.ts @@ -51,6 +51,13 @@ export const Shipping = { return this.$store.state.payment.methods } }, + watch: { + shipToMyAddress: { + handler () { + this.useMyAddress() + } + } + }, mounted () { if (!this.shipping.shippingMethod || this.notInMethods(this.shipping.shippingMethod)) { let shipping = this.shippingMethods.find(item => item.default) diff --git a/core/modules/user/components/UserShippingDetails.ts b/core/modules/user/components/UserShippingDetails.ts index d385a97dec..048a475317 100644 --- a/core/modules/user/components/UserShippingDetails.ts +++ b/core/modules/user/components/UserShippingDetails.ts @@ -38,6 +38,13 @@ export const UserShippingDetails = { mounted () { this.shippingDetails = this.getShippingDetails() }, + watch: { + useCompanyAddress: { + handler () { + this.fillCompanyAddress() + } + } + }, methods: { onLoggedIn () { this.currentUser = Object.assign({}, this.$store.state.user.current) diff --git a/src/themes/default/components/core/blocks/Checkout/Payment.vue b/src/themes/default/components/core/blocks/Checkout/Payment.vue index 7eeb4c1945..dcdfc5b441 100644 --- a/src/themes/default/components/core/blocks/Checkout/Payment.vue +++ b/src/themes/default/components/core/blocks/Checkout/Payment.vue @@ -47,7 +47,6 @@ class="col-xs-12 mb15" id="sendToBillingAddressCheckbox" v-model="sendToBillingAddress" - @click="useBillingAddress" > {{ $t('Use my billing data') }} diff --git a/src/themes/default/components/core/blocks/Checkout/Shipping.vue b/src/themes/default/components/core/blocks/Checkout/Shipping.vue index 7132576b34..bdc953cb75 100644 --- a/src/themes/default/components/core/blocks/Checkout/Shipping.vue +++ b/src/themes/default/components/core/blocks/Checkout/Shipping.vue @@ -37,7 +37,6 @@ v-if="currentUser && hasShippingDetails()" class="col-xs-12 mb10" id="shipToMyAddressCheckbox" - @click="useMyAddress" v-model="shipToMyAddress" > {{ $t('Ship to my default address') }} diff --git a/src/themes/default/components/core/blocks/MyAccount/MyShippingDetails.vue b/src/themes/default/components/core/blocks/MyAccount/MyShippingDetails.vue index adfc4f70d7..59de482577 100644 --- a/src/themes/default/components/core/blocks/MyAccount/MyShippingDetails.vue +++ b/src/themes/default/components/core/blocks/MyAccount/MyShippingDetails.vue @@ -61,7 +61,6 @@ class="col-xs-12 mb10" id="addCompanyFilled" v-model="useCompanyAddress" - @click="fillCompanyAddress" > {{ $t("Use my company's address details") }} From 181a66d638c5358b91d7c5ce3d8935ae38960920 Mon Sep 17 00:00:00 2001 From: Dmitry Schegolikhin Date: Sun, 19 May 2019 00:25:32 +0400 Subject: [PATCH 2/2] [2730] Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c607889ab..9a2b3e5c2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use event bus to emit 'application-after-init' event (#2852) - Validation of fields 'company name' and 'tax' in checkout doesn't work correctly - @dimasch (#2741) - Fixed wrong price displayed in instant checkout module - @vishal-7037 (#2884) +- Incorrect working of checkboxes in checkout - @dimasch (#2730) ### Changed / Improved - Changed the way to access the configuration. Currently the `rootStore.state.config` is deprecated. Please do use the `import config from 'config'` > `config` instead - @pkarw (#2649)