Integrating the Cart with Your Storefront
In this section, you'll make modifications to the showitem.php script from Chapter 20, “Creating an Online Storefront.” The goal is to transform the item information page into an item information page with a form for selecting colors, sizes, and quantities.
In the original script, insert the following before line 2:
Because the shopping cart elements are attached to the user through a session ID, the session must be started. The next changes don't occur until what was line 37 of the original script, so that's where we start Listing 21.1.
Listing 21.1. New Lines in showitem.php
37: <P><strong>Price:</strong> \$$item_price</p> 38: <form method=post action=\"addtocart.php\">"; 39: //get ...