<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = true %> <% 'call clean_shop_cart Dim strSql,rsproduct, counter, aroption, price, aroptions, subtotal, totalDiscount, strDiscounts, rsDiscounts Dim strID, iQnty, i, j, k, iQntProd, dExpire, key, iRights, iCount, iNumItems Dim fSubTotal, fSumTotal, iCol, sCol, sSize, cook, fWeight dim ardiscounts, rsDiscount, discount_ID, arusers, a, p %> View Shopping Cart

Your Shopping Cart

<% iQnty = Request.Cookies("Quantity") session("ebook") = 1 session("MemberShip") = 0 session("TotalWeight") = 0 session("Subtract") = 0 session("FixedFreight") = 0 session("TaxTotal") = 0 response.Cookies("TotalDiscount") = 0 if iQnty="" then iQnty = 0 if iQnty > 0 then Set rsproduct = Server.CreateObject("ADODB.Recordset") rsproduct.CursorType = adOpenStatic rsproduct.LockType = adLockOptimistic fSumTotal = 0 TotalDiscount = 0 iNumItems = 0 For i = 1 to iQnty strDiscounts = "" strID = Request.Cookies("Product")("P" & i) iQntProd = Request.Cookies("Product")("Q" & i) if iQntprod = "" then iQntprod = 1 strSql = "stor_get_more_info " & strID & "," & session("Group_ID") if strID = "" then for each cook in Response.Cookies Response.Cookies(cook).Expires = "January 1, 1980" next conn.close set conn = nothing response.Redirect("showcart.asp") end if Set rsproduct = Conn.Execute(strSql) if (Err<>0) then Set rsproduct = Nothing Conn.Close Set Conn = Nothing else iNumItems = iNumItems + cint(iQntProd) fWeight = rsProduct("Weight") if rsProduct("Shipping") then session("TotalWeight") = session("TotalWeight") + (rsProduct("weight") * CInt(iQntprod)) else session("Subtract") = session("Subtract") + (rsProduct("retail_price") * CInt(iQntprod)) end if if rsProduct("Tax") then session("TaxTotal") = session("TaxTotal") + (rsProduct("retail_price") * iQntProd) session("FixedFreight") = session("FixedFreight") + getFreight(strID, rsproduct("retail_price"), fWeight, iQntprod) fSubTotal = CDbl(rsproduct("retail_price")) * CInt(iQntprod) fSumTotal = fSumTotal + fSubTotal if not rsProduct("Ebook") then session("Ebook") = 0 if rsProduct("Membership") then session("MemberShip") = 1 session("RecyclePeriod") = rsProduct("RecyclePeriod") end if %> <%end if rsproduct.Close%> <%next Set rsproduct = Nothing%> <%else 'iQnty=0%> <% response.Cookies("TotalDiscount") = totalDiscount subtotal = subtotal - totalDiscount Response.Cookies("subtotal") = subtotal end if%>
Item No. Item to Purchase Qty. Price after Options Ext. Price Remove
<%=rsproduct("SKU")%> <%=rsproduct("Name")%>    <% counter = 1 for j = 1 to session("numoptions") if Request.Cookies("Product")("Option" & j & "_" & i) <> "" then Response.Write("
Option: ") exit for end if next do while counter <= session("numoptions") aroptions = split(Request.Cookies("Product")("Option" & counter & "_" & i),"^", -1, 0) if ubound(aroptions) >=1 then Response.Write(aroptions(0)) end if if len(Request.Cookies("Product")("Option" & counter + 1 & "_" & i)) > 2 and len(Request.Cookies("Product")("Option" & counter & "_" & i)) > 2 then Response.Write(", ") end if counter = counter + 1 loop 'Check to see if any Product Level discounts apply if rsProduct("Discounts") > "" or len(rsProduct("Discounts")) > 1 then ardiscounts = split(rsProduct("Discounts"),",") if ubound(ardiscounts) <= 0 then discount_ID = cint(arDiscounts(0)) set rsDiscount = server.CreateObject("ADODB.RECORDSET") rsDiscount.CursorLocation = adUseClient set rsDiscount = conn.execute("stor_Discounts_select_ID " & discount_ID) do while not rsDiscount.eof if cdbl(iqntProd) < rsDiscount("MinOrder") then TotalDiscount = totalDiscount - request.Cookies("Product")("Discount" & i) response.Cookies("Product")("Discount" & i) = 0 end if if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 0) then 'Single item product-level discount available to all users Response.Write("
Special: " & rsDiscount("Display")) totalDiscount = totalDiscount + get_Discount(discount_ID, cdbl(iQntProd), strID, i) end if if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 1) then 'Single item product-level discount available to selected users arusers = split(rsDiscount("Users"),",") if ubound(arusers) = 0 then if cint(session("User_ID")) = cint(arusers(0)) then Response.Write("
Special: " & rsDiscount("Display")) end if else if ubound(arusers) > 0 then for a = lbound(arusers) to ubound(arusers) if cint(session("User_ID")) = cint(arusers(a)) then Response.Write("
Special: " & rsDiscount("Display")) exit for end if next end if end if end if rsdiscount.movenext loop rsDiscount.Close set rsDiscount = nothing else 'Multiple Discounts for a single product for p = lbound(ardiscounts) to ubound(ardiscounts) strDiscounts = strDiscounts & arDiscounts(p) & "," next strDiscounts = left(strDiscounts, len(strDiscounts) - 1) set rsDiscounts = server.CreateObject("ADODB.RECORDSET") set rsDiscounts = conn.execute("stor_Discounts_select_in '" & strDiscounts & "'") iCount = 0 do while not rsDiscounts.EOF discount_ID = rsDiscounts("discount_ID") set rsDiscount = server.CreateObject("ADODB.RECORDSET") rsDiscount.CursorLocation = adUseClient set rsDiscount = conn.execute("stor_Discounts_select_ID " & discount_ID) if not rsDiscount.EOF then if iCount = 0 then if rsDiscount("Type4") = 0 then if cdbl(iqntProd) < rsDiscount("MinOrder") then TotalDiscount = totalDiscount - request.Cookies("Product")("Discount" & i) response.Cookies("Product")("Discount" & i) = 0 end if elseif rsDiscount("Type") = 1 then if cdbl(iQntProd) * rsProduct("retail_price") < rsDiscount("MinOrder") then TotalDiscount = totalDiscount - request.Cookies("Product")("Discount" & i) response.Cookies("Product")("Discount" & i) = 0 end if end if end if totalDiscount = totalDiscount + get_Discount(discount_ID, cdbl(iQntProd), strID, i) if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 0) then 'Single item product-level discount available to all users Response.Write("
Special: " & rsDiscount("Display")) end if if (rsDiscount("Type3") = 0 and rsDiscount("Type1") = 1 and rsDiscount("Type5") = 1) then 'Single item product-level discount available to selected users arusers = split(rsDiscount("Users"),",") if ubound(arusers) = 0 then if cint(session("User_ID")) = cint(arusers(0)) then Response.Write("
Special: " & rsDiscount("Display")) end if else if ubound(arusers) > 0 then for a = lbound(arusers) to ubound(arusers) if cint(session("User_ID")) = cint(arusers(a)) then Response.Write("
Special: " & rsDiscount("Display")) exit for end if next end if end if end if end if rsDiscount.Close set rsDiscount = nothing iCount = iCount + 1 rsDiscounts.MoveNext loop rsDiscounts.Close set rsDiscounts = nothing end if end if %>
onchange="recalculateOrder();" ID="Text1"> <% counter = 1 dim temp, strtemp2, count2 price = rsproduct("retail_price") for count2 = 1 to session("numoptions") if Request.Cookies("Product")("Option" & count2 & "_" & i) > "" then do while counter <= session("numoptions") aroption = split(Request.Cookies("Product")("Option" & counter & "_" & i),"^", -1, 0) if ubound(aroption) >= 1 then if left(aroption(1),4) = "plus" then temp = replace(aroption(1), "plus", "") price = price + cdbl(temp) elseif left(aroption(1),2) = "No" then price = price + 0 else price = cdbl(aroption(1)) end if end if counter = counter + 1 loop end if next subtotal = subtotal + price*iQntprod Response.Cookies("subtotal") = subtotal Response.Cookies("Order")("PriceAfterOptions" & i) = price %> <%=formatcurrency(price)%> <%=formatcurrency(price*iQntprod)%>

Currently, there are no records in the Shopping Cart.

<%end if %> <% 'Check to see if any store level discounts apply dim rsStoreLevel, fTempDiscount, strStoreDisplay set rsStoreLevel = server.CreateObject("ADODB.RECORDSET") set rsStoreLevel = conn.execute("stor_Discounts_select_store_level") fTempDiscount = subtotal - totalDiscount do while not rsStoreLevel.EOF if rsStoreLevel("Type4") = 0 then 'Based on the number of items if rsStoreLevel("Dollars") then if iNumItems >= rsStoreLevel("MinOrder") and fTempDiscount <= rsStoreLevel("MaxOrder") then totalDiscount = totalDiscount + rsStoreLevel("Amount") end if else if iNumItems >= rsStoreLevel("MinOrder") and fTempDiscount <= rsStoreLevel("MaxOrder") then totalDiscount = totalDiscount + (fTempDiscount * rsStoreLevel("Amount") * 0.01) end if end if elseif rsStoreLevel("Type4") = 1 then 'Based on the amount spent if rsStoreLevel("Dollars") then if fTempDiscount >= rsStoreLevel("MinOrder") and fTempDiscount <= rsStoreLevel("MaxOrder") then totalDiscount = totalDiscount + rsStoreLevel("Amount") end if else if fTempDiscount >= rsStoreLevel("MinOrder") and fTempDiscount <= rsStoreLevel("MaxOrder") then totalDiscount = totalDiscount + (fTempDiscount * rsStoreLevel("Amount") * 0.01) end if end if end if strStoreDisplay = rsStoreLevel("Display") rsStoreLevel.MoveNext loop rsStoreLevel.Close set rsStoreLevel = nothing if totalDiscount > 0 then %>
Total Discount(Special: <%=strStoreDisplay%>): <%=formatcurrency(totalDiscount)%>  
Subtotal: <%=formatcurrency(subtotal)%>  


/store/storefront.asp';" class="formbutton" ID="Button2" NAME="Button2">

 

<%response.Cookies("Order")("FixedFreight") = session("FixedFreight")%> <% conn.close set conn = nothing if request.QueryString("Redirect") = "checkout" and session("Membership") = 0 then response.Redirect("https://www.candlestickforum.com/store/checkout.asp") if request.QueryString("Redirect") = "checkout" and session("Membership") = 1 then response.Redirect("https://www.candlestickforum.com/member_registration.asp") %>