From e335c77208f15259ba4395bb3fa5c7a65294d86b Mon Sep 17 00:00:00 2001 From: Cristi Sandru <149154151+csandru-plenty@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:03:38 +0200 Subject: [PATCH] fix: sync checkout shipping costs (#843) * fix: sync checkout shipping costs * fix: sync checkout shipping costs * fix: sync checkout shipping costs --- .../web/composables/useCartTotalChange/useCartTotalChange.ts | 5 +++-- docs/changelog/changelog_en.md | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/composables/useCartTotalChange/useCartTotalChange.ts b/apps/web/composables/useCartTotalChange/useCartTotalChange.ts index 49fe86872..f0c5b8550 100644 --- a/apps/web/composables/useCartTotalChange/useCartTotalChange.ts +++ b/apps/web/composables/useCartTotalChange/useCartTotalChange.ts @@ -2,7 +2,7 @@ import { cartGetters } from '@plentymarkets/shop-api'; export const useCartTotalChange = () => { const route = useRoute(); - const { data: customerData } = useCustomer(); + const { data: customerData, isGuest, isAuthorized } = useCustomer(); const { getCart } = useCart(); const { getOrder } = usePayPal(); const { restrictedAddresses } = useRestrictedAddress(); @@ -29,8 +29,9 @@ export const useCartTotalChange = () => { if (restrictedAddresses.value) { state.value.changedTotal = cartGetters.getTotals(customerData.value.basket).total.toString() !== state.value.initialTotal; - await getCart(); } + + if (restrictedAddresses.value || isGuest.value || isAuthorized.value) await getCart(); }; return { diff --git a/docs/changelog/changelog_en.md b/docs/changelog/changelog_en.md index 2667ee201..e6bd05673 100644 --- a/docs/changelog/changelog_en.md +++ b/docs/changelog/changelog_en.md @@ -36,6 +36,7 @@ Each client supports two PWA instances. With this change, you can designate the ### 🩹 Fixed +- Resolved an issue where the shipping costs where not updated during guest checkout process. - Resolved an issue causing the Login modal to be unresponsive in the user interface. - Fix selling points misalignment on register page. - Introduced error handling to throw a 404 Not Found response when the requested product does not exist.