automate-sales / automate-commerce

next js ecommerce
https://ergonomica.vercel.app
MIT License
0 stars 0 forks source link

Improve lead and cart functionality #20

Open gkpty opened 8 months ago

gkpty commented 8 months ago

there should be a single function getVisitorInfo:

  1. recieves optional prop with {leadId, cartId}
  2. looks for the leadId and cart Id in localStorage

another function called getServerVisitorInfo that fetches visitor info from cookies

these 2 methods can be used on demand where they are needed, wether on a useEffect hook at a client component or on the server or server rendered page

optionally a global cache provider like Redux or hopefuly something simpler might work.. thing is itll have to wrapp the entire app and it might hinder performance..


a user should be able to be related to several leads, in case a user signs in on two different devices. -> manage different scenarios

gkpty commented 5 months ago

Update this so that a user and cart are fetched from cookies only. a cart will always be the given leads latest cart. create the functions:

gkpty commented 4 months ago

There are different use cases for managing lead/carts:

  1. users outside of europe that have cookies enabled
  2. users in europe with cookies enabled
    1. accept cookie banner
    2. reject cookie banner
  3. users that have disabled cookies

Whatever solution is implemented must make the cart and contact points work for any of the scenarios

gkpty commented 4 months ago

one potential solution that is cookie proof is using a custom headers in requests and using a server session id in the headers.