close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

I need to create a shopping cart sort of thing

Thread began 11/11/2018 6:23 pm by mrs | Last modified 11/12/2018 6:29 pm by mrs | 24 views | 1 replies

mrs

I need to create a shopping cart sort of thing

There's a number of questions in this one, so bear with me...

I need to allow users to add products to a cart, but the cart doesn't take payment. It just submits content for a quote. I was thinking of doing it something like this:

- The user visits the site
- I create a session that has a random generated number. Something like: if session isn't set, then generate a random number.
- When the user adds the product to the cart, the product ID and the random number get stored together in a database table via an insert.
- If the user wants to save the cart contents and return at a later date on a different device, then they to save their email address to a different database table. At the same time as entering the email address, the site inserts the random number into the same record.
- When the user returns, the session will create a new random number because the user hasn't identified themselves yet. When the user signs in using their email address the original stored random number overwrites and repopulates the session ID in order to retrieve cart contents. This allows the user to continue shopping or submit the cart for a quote.

Is this feasible?

Is this a lot of work that could be achieved in a simpler way? Are there any issues that you can foresee that I can't?

Would you store as a DB record or rather use something like a cookie? (I'm not quite sure how to work with cookies and how I might retain more than one product... there be dragons!).

The only problem I can see with the above is if the user is returning and they've added more products to the cart before signing in to retrieve previous cart contents, then any new products added to the cart after logging in might be lost or overwritten, which doesn't make for a very good UX! So (final question), how might I combine the newly added products to those already saved without losing either?

Thanks.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...