Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cart Prefix with a namespace scope for managing different carts for platforms #149

Open
dayhaysoos opened this issue Sep 8, 2020 · 2 comments
Labels
discussion Used as a discussion forum enhancement New feature or request on hold Depends on another issue to be fixed first.

Comments

@dayhaysoos
Copy link
Owner

With Stripe Connect apps, it would be ideal to have a way to separate carts for shoppers based on which merchants they are purchasing from

@andria-dev
Copy link
Collaborator

I'm not sure I completely understand what that entails for use-shopping-cart. Do you want to allow the developer to pass in a string that would be the LocalStorage key? So you'd have

export function CartProvider({ namespace='cart-values', /* other props */ }) {
  /* other code */

  const [cartValues, cartValuesDispatch] = useLocalStorageReducer(
    namespace,
    cartValuesReducer,
    cartValuesInitialState
  )

We could also just call it storageKey instead of namespace if that'd make it more obvious what it was doing.

@andria-dev andria-dev added discussion Used as a discussion forum enhancement New feature or request labels Feb 16, 2021
@dayhaysoos
Copy link
Owner Author

I like the idea of storageKey, but yeah the idea is to be able to store different carts per merchant based on this storage key

@dayhaysoos dayhaysoos added the on hold Depends on another issue to be fixed first. label Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Used as a discussion forum enhancement New feature or request on hold Depends on another issue to be fixed first.
Projects
None yet
Development

No branches or pull requests

2 participants