How to Develop an Online Shopping Cart (Part One)
Lawrence Cramer
Table of Contents
This is part one of a three-part series on shopping carts. In parts one and two, I will give you the background theory and knowledge to understand how shopping carts work and what you need to know to build one. In part three, I will lead you through actually building a simple shopping cart in ColdFusion using Dreamweaver MX 2004.
Today, many more developers are being asked to create e-commerce or shopping cart web sites for their clients or employers. At first, this can seem like a daunting and even frightening task. Let’s ease those fears by demystifying online shopping carts. To simplify things, I will break an e-commerce application, which is a shopping cart, into its basic components and analyze them one by one. As you go, you will progressively see how they work together.
There are many ways to approach the actual development, but regardless of size, server platform, database type or structure, the underlying logic remains the same. Once you have a handle on the basics, the details become clearer and less overwhelming. For this article, I will cover the first two components you will need to understand to get started.
The Cart
The logic behind an online shopping cart is actually quit simple. You simply need to remember what the customer wants to buy until they "check out" and place their order.
The Database
First, you must show the customer what you have to sell. You don't have to have a database for this, but you should. Then, once the customer places their order, you must capture the order for your records. This is where you use a database.