<% set conn = Server.Createobject("adodb.connection") set rs = server.createobject("adodb.recordset") conn.open connstr if session("orderid") = "" then orderid=0 else orderid = session("orderid") end if function numnotnull(x) if isnull(x) then numnotnull=0 else numnotnull=x end if end function %>
Shopping Cart
<% chrome_str = request.servervariables("HTTP_USER_AGENT") if InStr(chrome_str,"Chrome") <> 0 then response.write("

The Chrome browser is currently not supported. If you are receiving an error, we recommend using Internet Explorer, Firefox, or Safari

") end if %> <%if session("errmsg") <> "" then%>

<%=session("errmsg")%>

<% session("errmsg")="" end if %>

You can edit the quantities of the products you want and press the "Update Cart" button. When you have completed your selections, click on the "Check Out" link (above) to proceed with order.

 

<% msg=replace(request("msg"),", ","") if msg <> "" then %> <%=msg %>
<% end if %>

Click here to continue shopping

If you have a coupon code, please enter it below:

Coupon Code

<% coupon="" discount=0 ordertotal=0 shippingmethod=0 shipping=0 rs.open "select id,coupon,discount,subtotalprice,ordertotal, shippingmethod,shipping from orders where id = "&orderid,conn,3,3 if not rs.eof then discount=numnotnull(rs("discount")) ordertotal=numnotnull(rs("ordertotal")) coupon=rs("coupon")&"" if not isnull(rs("shippingmethod")) then shippingmethod=rs("shippingmethod") end if if not isnull(rs("shipping")) then shipping=rs("shipping") end if end if 'response.write "coupon=" & coupon & "
" 'response.write "discount=" & discount & "
" rs.close sql = "select orderdetail.id,products.price,orderdetail.qty,products.code,orderdetail.altcode,orderdetail.[option], orderdetail.productid,products.name from orderdetail inner join products on orderdetail.productid = products.id where orderid = "& orderid & " order by products.name " rs.open sql,conn,3,1 if not rs.eof then %>
>
<% i=0 subtotal=0 savings=0 itemcount=0 do while not rs.eof itemcount = itemcount + rs("qty") tmpprice1=rs("price") tmpprice = rs("qty") * tmpprice1 'discount = rs("price")-tmpprice1 code= rs("code") value="" if rs("altcode") &"" <> "" then code= rs("altcode") &"" value= rs("option") &"" end if %> <% i=i+1 subtotal = subtotal + tmpprice 'savings = savings + (rs("qty") * discount) rs.movenext loop %> <% if discount > 0 then %> <%end if %>
Code Name Quantity Price Subtotal
<%=code%>  <%=rs("name")%>  <% if value <> "" then response.write "- " &value %> "> "> "> " size="7" maxlength="3"> <%=formatcurrency(rs("price"))%> <%=formatcurrency(rs("qty")*rs("price"))%> 
Subtotal <%=formatcurrency(subtotal)%> 
Coupon <%=formatcurrency(discount)%> 
Total <%=formatcurrency(ordertotal-shipping)%> 
<% rs.close rs.open "select * from products where categoryid in (select id from categories where name='Shipping') order by orderposition",conn,3,1 if not rs.eof then response.write "" scount=0 selship=0 do while not rs.eof sel="" if shippingmethod=0 and scount=0 then selship = itemcount * rs("price") sel=" checked" elseif shippingmethod=rs("id") then selship = itemcount * rs("price") sel= " checked" end if scount=scount+1 response.write "" rs.movenext loop response.write "" response.write "
Shipping
" & rs("name") & "
" & rs("description") & "
" & formatnumber(rs("price") * itemcount,2) & "
Total" & formatnumber( ordertotal, 2) & "
" end if %> <% session("cart")=subtotal session("savings")=formatcurrency(savings) %>

Or

">

<% else %>



Your shopping cart is empty
<% end if rs.close conn.close %>

All orders to ship within 7-10 days. Any order inquires should to be e-mailed to sales@dyaco.ca.