## ## Document History ## ## Created (peeje01) ## 27-Apr-1999 (peeje01) ## Change include file name from -h.html to _h.html ## 02-Apr-2004 (fanra01) ## Bug 112091 ## Editorial changes from griel02. ## View Contents of Bag

View Contents of Bag

Doubtless the user will wish to view the contents of their shopping bag before confirming or cancelling the order. This page provides that important functionality, and consists of a select to present the entire contents of the bag. It also totals the cost and activates the Remove and Confirm options from the standard shop actions.

File: play_shopView.html

<html>
<head>
<title>View Bag Contents</title>
</head>
<body>
<h1>View Bag Contents</h1>

<!-- #ICE 
    DATABASE=`icetutor`
    SQL=`set lockmode session where readlock = nolock;
	select name, cost
	from play_item, play_order
	where id = product_id and
            (order_nr = :e_orderNumber and user_id = ':ii_userid')`
    TYPE=`TABLE`
-->

<!-- #ICE 
    DATABASE=`icetutor`
    SQL=`set lockmode session where readlock = nolock;
        select sum(cost)
	    from play_item, play_order
	    where id = product_id and
                (order_nr = :e_orderNumber and user_id = ':ii_userid')`
    HEADERS=`col1, Total`
    TYPE=`TABLE`
-->
<!-- #ICE REPEAT INCLUDE=`plays[play_shopAction_h.html]?Remove=Yes&Confirm=Yes` -->
<!-- Standard Session Control -->
<!-- #ICE REPEAT INCLUDE=`plays[play_SessionControl_h.html]` -->
</body>
</html>

When Web Deployment Option does not have a column name specified in the select statement--for example when we use a function--it names the columns col1, col2, .... In this case we are summing the cost column and, rather than having the total cost of our order shown with the heading col1, we use the HEADERS keyword to replace the generated column name with a more descriptive one, "Total". The code fragments appear below:

select sum(cost)
...
HEADERS=`col1, Total`

This page requires that we pass two variables into the parameterized included file play_shopAction_h.html. The variables must be separated by the & symbol:

<!-- #ICE REPEAT INCLUDE=`plays[play_shopAction_h.html]?Remove=Yes&Confirm=Yes` -->

Once satisfied with the contents of the shopping bag, the user will next want to confirm their purchases.