Skip to content

Commit 1242005

Browse files
authored
feat: add a storage key option so getCartId can support multiple carts (#416)
1 parent 8cb1373 commit 1242005

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/witty-seas-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@epcc-sdk/sdks-shopper": patch
3+
---
4+
5+
Add a storage key option so getCartId can support multiple carts
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PERSISTED_CART_STORAGE_KEY } from "./initialize-cart"
22

3-
export function getCartId() {
4-
return localStorage.getItem(PERSISTED_CART_STORAGE_KEY)
3+
export function getCartId(options?: { storageKey?: string }) {
4+
return localStorage.getItem(options?.storageKey ?? PERSISTED_CART_STORAGE_KEY)
55
}

0 commit comments

Comments
 (0)