php with an additional CartAction parameter to the original
query string. After making this change, execute the page to make sure you have your button in place, although you
can??™t really test how it works until finishing the presentation tier.
If you browse now to your favorite department or category and click the Add to Cart button of one of the products,
you??™re taken to a URL such as this:
index.php?CartAction=1&ItemId=10
The CartAction parameter appended at the beginning of the query string specifies the shopping cart action
requested by the visitor. When adding a new product, the action is coded with 1. At this moment, the new link gets
you to the home page because your site doesn??™t know yet how to interpret the CartAction query string parameter.
Displaying the Cart Summary
Instead of PayPal??™s View Cart buttons, we want to have a cart summary component with
a ???View details??? link, as shown in Figure 12-3. Implement the cart_summary componentized
template by following the steps of the next exercise.
CHAPTER 12 ?– CREATING YOUR OWN SHOPPING CART 381
Exercise: Displaying the Cart Summary
1. Let??™s start by removing the View Cart button. Locate and delete the following code in presentation/
templates/store_front.tpl: