From 909f04aeb6309a1ec76970a11a53524b9c3b1c1c Mon Sep 17 00:00:00 2001 From: Fabian Gerke <124085586+FabianGerke@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:28:08 +0100 Subject: [PATCH] fix: paypal readonly checkout (#859) Co-authored-by: cristian sandru Co-authored-by: Cristi Sandru <149154151+csandru-plenty@users.noreply.github.com> --- .../AddressSelect/AddressSelect.vue | 8 +++++ .../CheckoutPayment/CheckoutPayment.vue | 3 +- apps/web/components/CheckoutPayment/types.ts | 3 -- .../ShippingMethod/ShippingMethod.vue | 5 +-- apps/web/components/ShippingMethod/types.ts | 3 -- .../useAggregatedCountries.ts | 2 +- .../useCartTotalChange/useCartTotalChange.ts | 32 +++++++++++++++---- apps/web/lang/de.json | 3 +- apps/web/lang/en.json | 3 +- apps/web/pages/checkout.vue | 13 ++------ apps/web/pages/readonly-checkout.vue | 11 ++++--- docs/changelog/changelog_en.md | 1 + 12 files changed, 52 insertions(+), 35 deletions(-) diff --git a/apps/web/components/AddressSelect/AddressSelect.vue b/apps/web/components/AddressSelect/AddressSelect.vue index f314962b2..6d3b531b8 100644 --- a/apps/web/components/AddressSelect/AddressSelect.vue +++ b/apps/web/components/AddressSelect/AddressSelect.vue @@ -110,7 +110,15 @@ const persistCheckoutAddress = async (address: Address) => { }; const handleSetCheckoutAddress = async (address: Address) => { + const { isAuthorized } = useCustomer(); + const { restrictedAddresses } = useRestrictedAddress(); + const { handleCartTotalChanges } = useCartTotalChange(); + await persistCheckoutAddress(address); + + if (isAuthorized.value && restrictedAddresses.value) { + await handleCartTotalChanges(); + } }; const handleDeleteAddress = async (address: Address) => { diff --git a/apps/web/components/CheckoutPayment/CheckoutPayment.vue b/apps/web/components/CheckoutPayment/CheckoutPayment.vue index a9aefc674..ef40c7135 100644 --- a/apps/web/components/CheckoutPayment/CheckoutPayment.vue +++ b/apps/web/components/CheckoutPayment/CheckoutPayment.vue @@ -1,7 +1,7 @@