Chapter 12. Ordering and Shipping at the Winestore

We complete our description of the shopping components of the winestore by outlining the ordering and shipping modules in this chapter. The ordering module manages the conversion of the shopping cart discussed in Chapter 11 to an order. The module manages the most complex database interactions in the winestore and includes locking to address concurrency problems. The shipping module consists of two receipts: an email receipt that shows how the PHP mail( ) function is used in practice and an HTML receipt that is similar to the customer receipt in Chapter 10.

This chapter is the third of four that outline the complete winestore application. As in the previous two chapters, we emphasize that the scripts aren’t a production system but an illustration of web database application practice. We encourage use of the scripts for any purpose and suggest that the best method to understand the scripts is to view, edit, and use them while reading the chapter. We also emphasize that the descriptions in this chapter are outlines and that a full understanding of the scripts requires reading and using the code.

The scripts discussed in this chapter perform the following functions:

Finalize orders

Convert a shopping cart in the items and orders tables to an order and manage the sale of wine through the inventory table

Email receipts

Send a confirmation email to the user

HTML order receipts

Complete the ordering process with an HTML receipt that avoids ...

Get Web Database Applications with PHP, and MySQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.