;;; 6.mhtml: -*- Meta-HTML -*- 

;;;  Copyright (c) 1996 Universal Access Inc.
;;;  Author: Art Medlar, Henry Minsky (hqm@ua.com) Sat Jul 27 22:41:54 1996.

<set-var title="A Simple Shopping Basket">
<include header.mhtml>

<plain-text>
  Now that we have a session, we can use it to store products which the
  user selects, and build a 'shopping basket' which follows the
  user around the site.

  We will use a couple of session variables to keep
  track of  the products which the user selects.  We will
  also create a page which lists the contents of the
  shopping basket.

  For each item which the user selects, we need to record the product ID
  and the quantity of the order.  We will store this purchase
  information in a <sref Package Operators><i>package</i></sref>, and
  keep the packages in persistent session storage for each user.

  We will make a package named <code>BASKET</code>, which will hold
  an array of the users' selections.  Each selection in the array will
  actually be a package, which contains the product description, price,
  quantity, etc.

  Right now, the data on each product is embedded into the Web page
  which describes it. Our next task will be to create a real centralized
  product database, and use that to generate both the catalog Web pages,
  and the shopping basket entries.  While we're at it, we can use this
  database to keep an inventory of how many cakes are in stock, and what
  their backorder times are.

  Notice the use of the <funref package-to-alist> and <funref
						       alist-to-package> functions. These provide a convenient way to pass
  packages around and to store them into the session database. Also
  notice the use of <funref redirect> in the <code>purchase-order</code>
  macro. It is used in the case when the product order form
  is submitted, to redirect to our page which displays the shopping basket.

  <section-pages 6 show-basket.mhtml "The Shopping Basket">
  cake-template.mhtml
  basket.mhtml
  show-basket.mhtml
  session.mhtml
  red.mhtml
  green.mhtml
  black.mhtml
  blue.mhtml
  header.mhtml
  footer.mhtml
  </section-pages>

  <pagelist-control-panel>
</plain-text>

<include footer.mhtml>
