Skip to content

Commit 8ba35ed

Browse files
committed
Add cart ID + version to key to invalidate cart on currency change
1 parent 29cc7fb commit 8ba35ed

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

core/app/[locale]/(default)/cart/page-data.ts

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const CartPageQuery = graphql(
134134
site {
135135
cart(entityId: $cartId) {
136136
entityId
137+
version
137138
currencyCode
138139
lineItems {
139140
physicalItems {

core/app/[locale]/(default)/cart/page.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export default async function Cart() {
9898
cta: { label: t('Empty.cta'), href: '/shop-all' },
9999
}}
100100
incrementLineItemLabel={t('increment')}
101+
key={`${cart.entityId}-${cart.version}`}
101102
lineItemAction={updateLineItem}
102103
lineItems={formattedLineItems}
103104
summary={{

0 commit comments

Comments
 (0)