473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

four or five shopping cart design questions


High Level Session Handling Design for a Shopping cart
0) What am I missing?
1) How does OSCommerce do it?

I'm thinking about building a shopping cart from scratch,
using a library of dynamic screen generation routines
(already written) that take an XML stream as input from
various "search for products" forms. That way I can
run queries in one window and display the dynamic
results in another. The searching functions will probably
not index into a relational schema. Instead I'll use
Lucene to parse keywords and values out of XML-based product
descriptions. I know a lot about XML, Lucene, Xpath, XQuery
and dynamic screen rendering. But I have no experience
(at all) working with shopping carts in general.

2) How does repeat customer session handling usually work?
When a customer first logs in we generate a sessionID
and send it back to the client as a cookie.

Later on in the session, and before we can consumate a purchase,
they have to supply name address and (https) credit card number. We
put that stuff (not including the credit card number), along with the
sessionID, into a database of some kind. That part (customer contact info)
may well be mysql.

Any current shopping cart items are handled as
session memory items. Session memory will probably track items
with a hashed array of productObject types, which is a complex
object class that includes lots of generic stuff about each product
in the catalog (name, inventoryID, etc)
That way we can jump from screen
to screen without losing session, while finishing up at a "review cart" screen.

Review cart has cart-editing features (two of these, none of those)
plus contact information editing, plus a "Make Purchase" button that sends the transaction
off to a 3rd party transaction handler, sends an email receipt
to the customer and then prints a Thank You screen. It's probably a good idea NOT to store
credit card numbers on the server. Instead we hold it just
long enough to clear the transaction.

3) What security pitfalls surround holding credit card information
in session memory? How long do we keep credit card numbers?

5) If the customer negotiates his/her way all the way out to
the cart editing screen, where they do fill in a card number, name
and address, and then change their mind, and go back to
the shoppingMode screens, do we NULL out the credit card in
session memory? Or keep it around. And if so for how long?


Jan 18 '06 #1
2 2272
Forgot to add:

Each consumated purchase would exist as a hashed array of
productObjects, so I suppose that could be serialized,
associated with that users semi-permanent sessionID
and then persisted on the server, so the server
could retreive every known detail about every transaction,
after the fact.

So the shopping cart could recreate a transaction history
for that customer (do you want to see the details of
your 2nd to last order?)
Jan 18 '06 #2
d
"G.E.M.P" <sl*********@spammers.com> wrote in message
news:gZ********************@bresnan.com...


--------------------------------------------------------------------------------

High Level Session Handling Design for a Shopping cart
0) What am I missing?
1) How does OSCommerce do it?
Take notes from OSCommerce, but for the love of God don't use it ;)

OSCommerce stores a composite ID of the product and it's attributes (say
colour=blue, size=large) in the DB alongside the user's ID. That's
essentially it.
I'm thinking about building a shopping cart from scratch,
using a library of dynamic screen generation routines
(already written) that take an XML stream as input from
various "search for products" forms. That way I can
run queries in one window and display the dynamic
results in another. The searching functions will probably
not index into a relational schema. Instead I'll use
Lucene to parse keywords and values out of XML-based product
descriptions. I know a lot about XML, Lucene, Xpath, XQuery
and dynamic screen rendering. But I have no experience
(at all) working with shopping carts in general.
Shopping carts are scary to many developers, as it's usually a break from
the norm. They are, however, a great demonstration of where a small amount
of code, properly organised (as I'm sure yours will be), can provide a lot
of very useful functionality. It's just storing numbers next to each other.
The "cart" is simply a relationship between the user and a product, after
all.
2) How does repeat customer session handling usually work?
When a customer first logs in we generate a sessionID
and send it back to the client as a cookie.
Bingo.
Later on in the session, and before we can consumate a purchase,
they have to supply name address and (https) credit card number. We
put that stuff (not including the credit card number), along with the
sessionID, into a database of some kind. That part (customer contact info)
may well be mysql.
That's essentially it. When the user logs in, the session is
created/resumed. You can then add to that as and when you need to. When a
purchase is going to be made, you ask them for their details, etc (and
username/password), and set them up a user account. You can then create a
login script to populate the session with their stored data when they log
back in (say, cart contents).
Any current shopping cart items are handled as
session memory items. Session memory will probably track items
with a hashed array of productObject types, which is a complex
object class that includes lots of generic stuff about each product
in the catalog (name, inventoryID, etc)
That way we can jump from screen
to screen without losing session, while finishing up at a "review cart"
screen.
You just need to hold the composite IDs of the products, and their basic
display information (price, actual price, make, model, etc.).
Review cart has cart-editing features (two of these, none of those)
plus contact information editing, plus a "Make Purchase" button that sends
the transaction
off to a 3rd party transaction handler, sends an email receipt
to the customer and then prints a Thank You screen. It's probably a good
idea NOT to store
credit card numbers on the server. Instead we hold it just
long enough to clear the transaction.
You can hold it on the server - just do it sensibly. Obviously you should
get rid of it when you've used it, as you say.
3) What security pitfalls surround holding credit card information
in session memory? How long do we keep credit card numbers?
Don't keep it in session memory, unless you can guarantee that the path
where the sessions are being stored (assuming you're using the default
file-based sessions) is secure, and impossible for non-web-server users to
gain access to. You could write a custom session handler (really quite
easy) which incorporates some more advanced security features to assure the
security of the credit card information. Once you have their money, get rid
of the credit card information. That's law in many countries, so it's
better to be safe than in court ;)
5) If the customer negotiates his/her way all the way out to
the cart editing screen, where they do fill in a card number, name
and address, and then change their mind, and go back to
the shoppingMode screens, do we NULL out the credit card in
session memory? Or keep it around. And if so for how long?
Personally, I'd give the user the choice. You can have the credit card
information time out in the session, so if they don't go back to the
checkout in, say, 5 minutes, then your code will nullify the number in the
session.



I wish more people wrote their own shopping cart/store systems, as opposed
to just relying on OSCommerce and its derrivations (zen cart, I'm looking at
you). Those products simply suck, and if talented folks make their own,
their grip of mediocrity will be broken. Good luck!
Jan 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Phil Powell | last post by:
I need a back-to-basics shopping cart tutorial in PHP/mySQL. I thought I had it down and I failed, as usual. Here is what I mapped out as a spec: 3) initial work on bestilling.php to contain the...
2
by: Erik | last post by:
Does anybody know of a free ASP shopping cart or some free ASP code to help someone get a shopping cart started. Or does anybody have any experience using a ASP shopping cart that is inexpensive...
2
by: Don Grover | last post by:
I am retrieving costs and product id's from a sql db. and need to build a shopping cart around it. How do I store the selected items and qty req so I can move into another catalog and total up as...
16
by: Pierre Jelenc | last post by:
I need to lay out a page with five main elements: A fixed div at the top containing a navigation bar, two side-by-side columns, a centered shopping cart at the bottom, and a full-window fixed div...
1
by: Jia Sun | last post by:
hello , everybody , i need a similar program , just like fancyimport.com if possible, pls contact me ,thank you very much . inchina@gmail.com
5
by: VM | last post by:
I'm interested in creating a simple shopping cart in C#. Are there sites that show you, step by step, how to create a simple cart? The sites I've found only show you pre-made shopping carts that...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the checkout.php script is given below <?...
6
by: frank | last post by:
can anyone point me to a free shopping-cart script?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.