When the visitor clicks the View Cart button, a page like the one shown
in Figure 12-1 appears.
Figure 12-1. The TShirtShop shopping cart
Our shopping cart will have a ???Save for later??? feature, which allows the visitor to order
only a subset of the products in the cart and save the other items for purchase at a later time.
When a product is saved for later, it??™s moved to a separate list of the shopping cart and is not
included in the order when the visitor checks out (see Figure 12-2).
In all the other pages except the shopping cart page, the visitor will be able to see a shopping
cart summary in the left part of the screen, as shown in Figure 12-3.
CHAPTER 12 ?– CREATING YOUR OWN SHOPPING CART 364
Figure 12-2. The TShirtShop ???Save for later??? feature
Figure 12-3. The TShirtShop shopping cart summary
CHAPTER 12 ?– CREATING YOUR OWN SHOPPING CART 365
Before starting to write the code for the shopping cart, let??™s take a closer look at what we??™re
going to do.
First, note that you won??™t have any user personalization features at this stage of the site.
It doesn??™t matter who buys your products at this point; you just want to know what products
were sold and when. When you add user customization features in the later chapters, your
task will be fairly simple: when the visitor authenticates, the visitor??™s temporary (anonymous)
shopping cart will be associated with the visitor??™s account.
Pages:
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472