<%@ Language=VBScript %><% '************************************************************ '* * '* By Downloading or using this software, you agree to * '* the terms and conditions as stated in the Software * '* License Agreement. An updated copy of this agreement * '* can be seen at http://www.pagedowntech.com/terms. * '* * '* NOTICE: We do not recommend changing the code below * '* as it may interfere with future updates/upgrades. * '* * '* PageDown Technology, LLC., Copyright 2005. * '* www.pagedowntech.com * '* * '************************************************************ %> <% sDBExtraPath = "../" sExtraTemplatePath = "../" sCurrentPage = "products" %> <% public opttexterror cartid = Request.cookies("cartid") orderid=request.cookies("orderid") buygc=request.cookies("buygc") fromrev=request("fromrev") refer=request("refer") itemid=request("itemid") qty=request("qty") recid=request("recid") optaid=request("optaid") optbid=request("optbid") optcid=request("optcid") catcount=request("catcount") updatedisc=request("updatedisc") affillink=request.cookies("affillink") tempsubtotal=request.form("tempsubtotal") delcartitem=request.form("chgcartitem") updatedisc2=request("updatedisc2") updategift=request.form("updategift") task=request.form("task") 'If adding to cart using link if task="" then tasktemp=request.querystring("task") if tasktemp="" then else task=tasktemp addvialink="Y" end if end if 'Check if adding via Javascript QuickAdd function. if task="quickadd" then task="addnew" addvialink="Y" end if 'Check new additions to cart for errors if task="remove" then response.write(recid) response.write(task) 'response.end end if 'Get Discount Codes discamt=request.cookies("discamt") discpct=request.cookies("discpct") if updatedisc="Y" then disccode=request.form("disccode") else disccode=request.cookies("disccode") end if if discamt="" then discamt=0 end if if discpct="" then discpct=0 end if 'Get Gift Certificate giftcode=request.cookies("giftcode") giftamt=request.cookies("giftamt") if giftamt="" then giftamt=0 'Check for cart session id, if none then create one. if cartid="" then Randomize Dim MyNum temp1 = replace(Time, " ", "") temp1 = replace(temp1, ":", "") temp2 = replace(date, " ", "") temp2 = replace(temp2, "/", "") temp2 = replace(temp2, ".", "") cartid = temp2 & temp1 & Int((9999999999- 5 + 1) * Rnd + 5) Response.Cookies("cartid")= cartid end if 'If carrier already setup, and user is adding items, remove carrier so they can reselect it. carrier=request.cookies("carrier") if task<>"" then Response.cookies("carrier")="redo" carrier="redo" end if 'Get Affiliate ID affillink=request.cookies("affillink") if affillink="" or isnull(affillink) then affillink=request.form("affillink") if affillink<>"" then response.cookies("affillink")=affillink response.cookies("affillink").expires=DateAdd("d", 365, Date) end if affillink=request.querystring("affillink") if affillink<>"" then response.cookies("affillink")=affillink response.cookies("affillink").expires=DateAdd("d", 365, Date) end if end if if task="remove" then Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.Open "Select * From orderdetail WHERE cartid='" & cartid & "' AND id=" & recid, DB, 3,1 if not rs2.eof then giftid=rs2("giftid") end if rs2.Close set rs2=nothing Set rs6 = db.Execute("DELETE From orderdetail WHERE cartid='" & cartid & "' AND id=" & recid) set rs6 = nothing Set rs5 = db.Execute("DELETE FROM orderdetail WHERE cartid='" & cartid & "' AND subof=" & recid) set rs5 = nothing if giftid>0 then Set rs5 = db.Execute("DELETE FROM giftcert WHERE id=" & giftid & " AND code='" & cartid & "'") set rs5 = nothing end if pdredirect(shopcarturl) end if 'If adding. if task="addnew" then %> <% end if 'If item is changed. if task="update" then %> <% end if 'Check if cart items require shipping. if cartid="" or isnull(cartid) then response.cookies("mustship")="" else set rs=openrs("SELECT id FROM orderdetail WHERE cartid='" & cartid & "' AND digital='' AND itemno>0 OR cartid='" & cartid & "' AND digital IS NULL AND itemno>0") if not rs.eof then response.cookies("mustship")="Y" mustship="Y" else response.cookies("mustship")="" mustship="" end if rs.close set rs=nothing end if 'Determine what link will be used for "checkout" button (fromrev is from order review). if fromrev="yes" then checkoutlink="orderreview.asp?refer=" & refer Else if refer="" or refer=NULL then checkoutlink="checkout1.asp" else checkoutlink=refer end if End If 'Check for Gift Certificates in cart. if buygc="Y" then set rs=openrs("SELECT * FROM orderdetail WHERE giftid>0 AND cartid='" & cartid & "'") if not rs.eof then hasgcincart="Y" if giftcode<>"" then updategift="Y" end if if disccode<>"" then updatedisc="Y" end if end if rs.close set rs=nothing end if 'Apply Gift Certificate if updategift="Y" then %> <% end if 'Discounts. if updatedisc="Y" then %> <% end if 'Get Cart contents %> <% 'Check for Inventory Errors if inverror="Y" then message=geterrtext("err3") end if 'Set page columns. zpage=pg9 %> <% getleftside(zpage)%> <% getsecspace ()%> <% getHeading "heads3", heads3, "", 2 %> cellpadding="5" cellspacing="0" width="100%">
<%=fixERR(message)%>
<% if cartempty="yes" then%> <% end if %> <% if hidebancorn=0 or isnull(hidebancorn) then %> <% end if %>
 

<%=getsystext("sys1")%>/<%=getsystext("sys2")%> <%=getsystext("sys3")%> <%=getsystext("sys4")%> <%=getsystext("sys5")%>

 
<% count=0 for a=1 to ubound(carritemid) if carrsubof(a)=0 then count=count +1 itemsub=carrprice(a) itemid=carritemid(a) recid=carrrecid(a) qty=carrqty(a) giftid=carrgiftid(a) if carrinverr(a)="Y" then showast="*" else showast="" end if %> <% if carrhasopt(a)="Y" then %> <% end if %> <% for b=1 to ubound(carritemid) if carrsubof(b)=carrrecid(a) then %> <% itemsub=itemsub + carrprice(b) end if next %> <% if carrhasopt(a)="Y" then %> <% end if %>
<%=carrname(a)%>
<%=carritemno(a)%>
<%=showast%> <%=showcurr(carrprice(a))%> <% if carrhasopt(a)="" then %><%=showcurr(carrqty(a)*carrprice(a))%><% end if %>
<%=getsystext("sys119")%>
<%=carrname(b)%>  <%=carritemno(b)%> <%=carrsprice(b)%>
____________
<%=showcurr(itemsub)%> <%=showcurr(itemsub*carrqty(a))%>
<%if carrhasopt(a)="Y" then%> <%end if%> <%if giftid>0 then%> <%end if%> <%if giftid>0 then%> <%else%> <%end if%>
<% showbutton "butts15",butts15,shopurl & "shop/item.asp?itemid=" & itemid & "&qty=" & qty & "&edititemid=" & recid & "&cartid=" & cartid, "" %><% showbutton "butts15",butts15,shopsslurl & "shop/giftcert.asp?lang=" & iEcommLangID & "&giftid=" & giftid & "&task=edit", "" %><% showbutton "butts9", butts9, "javascript: document.updateitems.submit()","" %><% showbutton "butts19",butts19,shopcarturl & "?recid=" & recid & "&task=remove&lang=" & iEcommLangID, "" %>

<% end if%> <% next %>
 
 
<%=geterrtext("err52")%>
 
     
     
 
 
 
<% if discen="1" then %>

<%=getsystext("sys7")%>
<%=tshowcarth%>
<%=getsystext("sys8")%>    <% showbutton "butts11", butts11, "","discform" %>
<%=fixERR(discountmessage)%>
<% end if %>
<% if giften="1" then %>

<%=getsystext("sys9")%>
<%=tshowcartbb%>
<%=getsystext("sys10")%>    <% showbutton "butts22", butts22, "","giftform" %>
<%=fixERR(giftmessage)%>
<% end if %>
 
 
 
  <% if discamt>0 or discpct>0 then %> <% end if %> <% if carrierrate>0 then %> <% end if %> <% if ordertaxtotal>0 then %> <% end if %> <% if giftamt>0 then %> <% end if %>
     
<%=getsystext("sys11")%>   <%=showCurr(ordertotala)%>
<%=getsystext("sys7")%>   -<%=showCurr(discounts)%>
<%if ratemethod="2" then response.write ("*") end if %><%=getsystext("sys39")%>   <% if ratemethod="3" then response.write getsystext("sys109") else response.write showCurr(carrierrate) end if %>
<%=getsystext("sys60")%>   <%=showCurr(ordertaxtotal)%>
 
<%=getsystext("sys11")%>   <%=showCurr(ordertotalc)%>
<%=getsystext("sys9")%>   -<%=showCurr(giftamt)%>
 
<%=getsystext("sys61")%>   <%=showCurr(grandtotal)%>
<%=getsystext("sys12")%>   <%=pitemcount%>
 
     
     
  <% if subtotal>=0 and cartempty<>"yes" and inverror<>"Y" then %>
<% showbutton "butts13", butts13, shopsslurl & "shop/" & checkoutlink,"" %>


<% end if%>
<% showbutton "butts9",butts9, "javascript: document.updateitems.submit()","" %> <% showbutton "butts10",butts10, shopurl & "shop/","" %>
 
     
 
<% getrightside(zpage)%>