Skip to content

Commit 863c4b6

Browse files
KevinGorjanMarcin Kwiatkowski
authored andcommitted
fix: billing address overwrites shipping address when copy flag is set (#510)
* fix(theme): don't redirect with empty cart on thank-you step during the checkout * fix(theme): fix on billing step when address for shipping and billing are the same When addresses are the same, hide the form on the billing-step so users can't fill in a new address * chore(theme): added missing translations
1 parent 4bd5536 commit 863c4b6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/theme/pages/Checkout/Billing.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717
class="form__element"
1818
@change="handleCheckSameAddress"
1919
/>
20+
<div v-if="sameAsShipping" class="copy__shipping__addresses">
21+
<div class="copy__shipping__address">
22+
<div class="sf-address">
23+
<UserAddressDetails :address="{... billingDetails, region: {region_code: billingDetails.region}}" />
24+
</div>
25+
</div>
26+
</div>
27+
<UserBillingAddresses
28+
v-if="!sameAsShipping && isAuthenticated && hasSavedBillingAddress"
29+
v-model="setAsDefault"
30+
v-e2e="'billing-addresses'"
31+
:current-address-id="currentAddressId || NOT_SELECTED_ADDRESS"
32+
@setCurrentAddress="handleSetCurrentAddress"
33+
/>
2034
<div
2135
v-if="sameAsShipping"
2236
class="copy__shipping__addresses"
@@ -269,6 +283,7 @@ import {
269283
SfSelect,
270284
SfCheckbox,
271285
} from '@storefront-ui/vue';
286+
import UserAddressDetails from '~/components/UserAddressDetails.vue';
272287
import {
273288
useUserBilling,
274289
userBillingGetters,

0 commit comments

Comments
 (0)