;;; cake-template.mhtml: -*- Meta-HTML -*-  Shopping Basket Example.
;;;
;;;  Copyright (c) 1996 Universal Access Inc.
;;;  Author: Art Medlar, Henry Minsky Fri Jul 26 18:19:12 PDT 1996

;;; usage: 
;;; <cake-template>
;;;  .. your HTML goes here...
;;; </cake-template>
<defmacro cake-template>
  <table>
    <tr>
      <td width="30%">
	<img src="../images/<get-var cake-picture>">
      </td>

      <td valign=middle>
	<strong><font size="+2" color="<get-var cake-color>">
	<get-var cake-title>
	</font></strong>
      </td>
    </tr>

    <tr>
      <td colspan=2>
	<br>
	%body
      </td>
    </tr>

    ;;; If there is a listed price, display it.
    <tr>
      <td>
	<if <gt <get-var item::inventory> 0>
	    "There are <get-var item::inventory> of these cakes in stock."
	  "I'm sorry, we are temporarily out of stock on these.
	The next delivery will be on <get-var item::delivery>."
	  >
      </td>
    </tr>

    <when <get-var cake-price>>
      <tr> <th align=left>Price: $<get-var cake-price></th> </tr>
    </when>
  </table>
<purchase-order>
</defmacro>

;;; Load the record for this catalog item
<define-tag get-cake item-number>
  <set-var loaded=<get-product <get-var item-number>>>

  <set-var
    cake-url	 = <get-var item::url>
    cake-id	 = <get-var item::product-id>
    cake-picture = <get-var item::picture>
    cake-color   = <get-var item::color>
    cake-title   = <get-var item::title>
    cake-price   = <get-var item::price>>

</define-tag>
