Storing a Guest's Items

Hello. I am trying to build my own ecommerce module, and realizing there is more to this than meets the eye!

Not sure why I am so confused, because I spent way too much money online, but I guess everything looks easier from the outside looking in?!

Here is one of many things I don’t really understand…

If a person is shopping on my website, and they don’t have an account, how should I keep track of anything they want to buy?

I will use the term “Guest” for them.

I am trying to program a simple module that lets someone sign up for "premium content - I believe SitePoint has something like that too, right?

Originally I was going to do everything on one page, but then one of my offers requires people to pick out a free book and that requires navigating around my site and that’s when I realized I don’t know how to store what they originally selected, because it isn’t like I can store that info in a customer record in the database because, after all, they are merely a “Guest”.

Not sure if I am making any sense?

I would check out a “session variable”.

Can you give me a little more than that?

I would just do a internet search; this result looks like it would give you most of the information you need.

One small problem is if the user leaves and comes back the data stored in the session variable will be lost.

You could save the items in a cookie or in the browser via LocalStorage.

1 Like

See Client-side storage. It describes the available options. There are some others but they are either browser dependent and/or obsolete.

I am not sure of the details but Google Chrome supports persistence of a database within Google account clouds.

I have used an indexed DB API and I forget what it is called but it is designed for use by extensions.

The following articles also appear helpful.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.