<% Call LogIt("show_cart.asp", "", "", "", "", "", "", "") SQL = "SELECT p.product_id, p.name, p.price, p.short_description, c.quantity FROM product p, cart c WHERE c.product_id = p.product_id and c.username='" & SqlEsc(Session("username")) & "' order by p.sortorder desc" Set RS = Conn.Execute(SQL) Total=0 strO = "" %>
Shopcart


<% Counter=1 Do While Not RS.EOF Price = FormatNumber(RS("price"), 2) Quantity = FormatNumber(RS("quantity"), 0) %> <% RS.moveNext Counter = Counter + 1 Total = Total + Price*Quantity Loop If Total > 0 Then %> <% SQL = "SELECT p.name FROM product p, cart c, orderline ol, orderhead oh WHERE c.product_id = p.product_id and c.product_id = ol.product_id and ol.order_id = oh.order_id and c.username='" & SqlEsc(Session("username")) & "' and oh.username = c.username and oh.status = 'OK' group by p.name order by p.sortorder desc" Set RS = Conn.Execute(SQL) If not RS.EOF Then %> <% Else %> <% End If %> <% Else %> <% End If %>
Product Price Quantity Total
"><% = RS("name") %>
">Remove
$<% = FormatNumber(Price,2) %> " name="quan_<% =Server.Urlencode(rs("product_id")) %>" size="2" max="2" maxlength="4" type="text" value="<% = Quantity %>"> " value="<% = Price %>"> $"><% = FormatNumber(Price*Quantity) %>
Total: $<% =FormatNumber(Total, 2) %>
<% strO = "You have previously bought license for " counter = 0 Do While Not RS.EOF If Counter > 0 Then strO = strO & ", " End If strO = strO & RS(0) Counter = Counter + 1 RS.moveNext Loop strO = strO & "." strO = strO & " If you wish to purchase additional licenses, please check this box. If not, please remove the product from the cart." Response.write(strO) strO2 = Replace(strO, "please check this box", "please check the box") %>


Shopping cart is empty