Skip to content

Commit

Permalink
fix: sync checkout shipping costs (#843)
Browse files Browse the repository at this point in the history
* fix: sync checkout shipping costs

* fix: sync checkout shipping costs

* fix: sync checkout shipping costs
  • Loading branch information
csandru-plenty authored Nov 28, 2024
1 parent 33b6ca1 commit e335c77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/web/composables/useCartTotalChange/useCartTotalChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e335c77

Please sign in to comment.