|
26 | 26 | ...billingDetails, |
27 | 27 | region: { region_code: billingDetails.region }, |
28 | 28 | }" |
29 | | - /> |
| 29 | + > |
| 30 | + <template #country> |
| 31 | + {{ shippingDetailsCountryName }} |
| 32 | + </template> |
| 33 | + </UserAddressDetails> |
30 | 34 | </div> |
31 | 35 | </div> |
32 | 36 | </div> |
@@ -360,6 +364,11 @@ export default defineComponent({ |
360 | 364 |
|
361 | 365 | const countries = ref<Country[]>([]); |
362 | 366 | const country = ref<Country | null>(null); |
| 367 | +
|
| 368 | + const shippingDetailsCountryName = computed(() => countries |
| 369 | + .value |
| 370 | + .find((countryItem) => countryItem.id === shippingDetails.value?.country.code)?.full_name_locale ?? ''); |
| 371 | +
|
363 | 372 | const { isAuthenticated } = useUser(); |
364 | 373 | let oldBilling : CheckoutAddressForm | null = null; |
365 | 374 | const sameAsShipping = ref(false); |
@@ -481,13 +490,10 @@ export default defineComponent({ |
481 | 490 | const [defaultAddress = null] = userBillingGetters.getAddresses(loadedUserBilling, { default_shipping: true }); |
482 | 491 | const wasBillingAddressAlreadySetOnCart = Boolean(loadedBillingInfoBoundToCart); |
483 | 492 |
|
484 | | -<<<<<<< HEAD |
485 | | -======= |
486 | 493 | // keep in mind default billing address is set on a customer's cart during cart creation |
487 | | ->>>>>>> 8578149e (chore: fix commit wording) |
488 | 494 | if (wasBillingAddressAlreadySetOnCart) { |
489 | 495 | const userAddressIdenticalToSavedCartAddress = findUserAddressIdenticalToSavedCartAddress( |
490 | | - loadedUserBilling.addresses, |
| 496 | + loadedUserBilling?.addresses, |
491 | 497 | loadedBillingInfoBoundToCart, |
492 | 498 | ); |
493 | 499 |
|
@@ -523,6 +529,7 @@ export default defineComponent({ |
523 | 529 | setAsDefault, |
524 | 530 | billingDetails, |
525 | 531 | sameAsShipping, |
| 532 | + shippingDetailsCountryName, |
526 | 533 | addresses, |
527 | 534 | }; |
528 | 535 | }, |
|
0 commit comments