Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2730 checkboxes #2919

Merged
merged 6 commits into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions core/modules/checkout/components/Payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ export const Payment = {
handler () {
this.useShippingAddress()
}
},
sendToBillingAddress: {
handler () {
this.useBillingAddress()
}
},
generateInvoice: {
pkarw marked this conversation as resolved.
Show resolved Hide resolved
handler () {
this.useGenerateInvoice()
}
}
},
methods: {
Expand Down
7 changes: 7 additions & 0 deletions core/modules/checkout/components/Shipping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions core/modules/user/components/UserShippingDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
class="col-xs-12 mb15"
id="sendToBillingAddressCheckbox"
v-model="sendToBillingAddress"
@click="useBillingAddress"
>
{{ $t('Use my billing data') }}
</base-checkbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
class="col-xs-12 mb10"
id="addCompanyFilled"
v-model="useCompanyAddress"
@click="fillCompanyAddress"
>
{{ $t("Use my company's address details") }}
</base-checkbox>
Expand Down