bigcommerce / storefront-data-hooks

Hooks for React Storefront UI Components
MIT License
166 stars 36 forks source link

Is it possible to use Persistent Carts via the data hooks? #34

Closed avisra closed 3 years ago

avisra commented 3 years ago

https://support.bigcommerce.com/s/article/Persistent-Cart

For example, as a user - if I login and add items to my cart on my computer. And then later login on my phone - I would expect to see the same items in my cart over there.

jorgemasta commented 3 years ago

After enabling the Persistent Cart in the BigCommerce dashboard, I have done a little experiment:

  1. Login with a user, add some products the cart
  2. Login with the same user in a incognito tab
  3. 😩 The cart is empty

Why? Because when a user creates a cart, the Cart ID is stored in the cookies. So when logging in on another device, we need that ID, which we have no way of knowing.

A potencial solution is, after logging in, to get all the active carts of a user and save in the cookies the id of the most recent cart. However, this is now possible with the BigCommerce API.

I have asked about this on the BigCommerce support page.

I am closing this issue until further notice