After going through the experience of DRB in the past few pages, you will find doing a Shopping Cart is like bathing in the summer breeze.
Click on the Shopping Cart on the right and you will see the cart.htm coming up with three TEAs in the main content area: /cart/form&Content, /cart/form&Empty and /cart.htm&checkoutForm, and you certainly what they are used for.
If the shopping cart is empty, the "Empty" layout will show. Otherwise, the Content layout followed by the Checkout form will show instead.
With the Cart Form Content layout, you can apply the same THEAD and TBODY technique as in DRB. The quantity field (which is not in the database) is set to be Qty (scheme%cart&QtyName).
While the unique key of the product table in the database is ID (scheme%dbo&keyfield), the owner may have another unique code to identify the product, in this case "Ref" (scheme%cart&CodeName). Also, the price field name is "Price" (scheme%cart&PriceName).
The quantity, product code and price are the only three things that will be submitted to the owner after checking out. All the rest in scheme%cart&Attribute are for the visitors. You can include any of these attributes in the Cart Form Content layout.
In /cart/form&Content, you may use the following system variables:
- {_calculatebutton}: The Calculate button
- {_emptybutton}: The "Empty my cart" button
- {_shopbutton}: The "Shop again" button if ShopCaption and ShopHref are defined in scheme%cart&.
- {_subtotal}: The Qty * Price for the item
- {_total} (a running total)
|