The Shopping Cart

Once you have created a product catalog, as I have now, the actual shopping cart itself can be surprisingly simple. The method I’ve chosen to use in this example is to record the product IDs and quantities to a session. Knowing these two things will allow the scripts to calculate totals and do everything else required.

The Checkout Process

The checkout process (which I will not discuss in detail) involves four steps:

1.
Confirmation of the order.
2.
Confirmation/submission of the billing and shipping information.
3.
Processing the order.
4.
Submitting the order to the database.

Steps 1 and 2 should be easy enough for intermediate programmers to complete on their own by now. In all likelihood, most of the data in step 2 would ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.