<%
'This file is part of ProductCart, an ecommerce application developed and sold by Early Impact LLC. ProductCart, its source code, the ProductCart name and logo are property of Early Impact, LLC. Copyright 2001-2003. All rights reserved. You are not allowed to use, alter, distribute and/or resell any parts of ProductCart's source code without the written consent of Early Impact. To contact Early Impact, please visit www.earlyimpact.com.
%>
<% response.Buffer=true %>
<!--#include file="../includes/settings.asp"-->
<!--#include file="../includes/storeconstants.asp"-->
<!--#include file="../includes/emailsettings.asp"-->
<!--#include file="../includes/languages.asp"-->
<!--#include file="../includes/languages_ship.asp"-->
<!--#include file="../includes/bto_language.asp"-->
<!--#include file="../includes/productcartinc.asp"-->
<!--#include file="../includes/currencyformatinc.asp"-->
<!--#include file="../includes/shipFromSettings.asp"-->
<!--#include file="../includes/productcartFolder.asp"-->
<!--#include file="../includes/opendb.asp"-->
<!--#include file="../includes/adovbs.inc"-->
<!--#include file="header.asp"-->
<% dim query, conntemp, rs
on error resume next
If scStoreOff="1" then
response.redirect "msg.asp?message=83"
End If
dim pcCartArray, pcCartIndex, f, total, totalDeliveringTime
pcCartArray=Session("pcCartSession")
pcCartIndex=Session("pcCartIndex")
total=Cint(0)
totalDeliveringTime=Cint(0)
if countCartRows(pcCartArray, pcCartIndex)=0 then
response.redirect "msg.asp?message=1"
end if
call opendb()
'see if there are any ship types setup for this store
dim iShipService
iShipService=0
query="SELECT * FROM shipService WHERE serviceActive=-1;"
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if rs.eof then
iShipService=1
end if
set rs=nothing
%>
<script language
="JavaScript">function win(fileName)
{
myFloater=window.open('','myWindow','scrollbars=yes,status=no,width=520,height=400')
myFloater.location.href=fileName;
}
function validateNumber(field)
{
var val=field.value;
if(!/^\d*$/.test(val)||val==0)
{
alert("<%response.write dictLanguage.Item(Session("language")&"_showcart_2")%>");
field.focus();
field.select();
}
}
</script>
<script>
function isDigit(s)
{
var test=""+s;
if(test=="0"||test=="1"||test=="2"||test=="3"||test=="4"||test=="5"||test=="6"||test=="7"||test=="8"||test=="9")
{
return(true) ;
}
return(false);
}
function allDigit(s)
{
var test=""+s ;
for (var k=0; k <test.length; k++)
{
var c=test.substring(k,k+1);
if (isDigit(c)==false)
{
return (false);
}
}
return (true);
}
function checkproqty(fname,qty,ctype)
{
if (fname.value == "")
{
alert("<%=dictLanguage.Item(Session("language")&"_alert_4")%>");
fname.focus();
return (false);
}
if (allDigit(fname.value) == false)
{
alert("<%=dictLanguage.Item(Session("language")&"_alert_5")%>");
fname.focus();
return (false);
}
if (fname.value == "0")
{
alert("<%=dictLanguage.Item(Session("language")&"_alert_5")%>");
fname.focus();
return (false);
}
if (qty > 0)
{
if (ctype > 0)
{
TempValue=eval(fname.value);
TempV1=(TempValue/qty);
TempV1a=TempValue*TempV1;
TempV2=Math.round(TempValue/qty);
TempV2a=TempValue*TempV2;
if ((TempV1a != TempV2a) || (TempV1<1))
{
alert("<% Response.write(dictLanguage.Item(Session("language")&"_alert_3"))%>" + qty);
fname.focus();
return (false);
}
}
else
{
TempValue=eval(fname.value);
if (TempValue < qty)
{
alert("<% Response.write(dictLanguage.Item(Session("language")&"_alert_8"))%>"+qty+"<% Response.write(dictLanguage.Item(Session("language")&"_alert_9"))%>");
fname.focus();
return (false);
}
}
}
return (true);
}
</script>
<% dim strRedirectSSL
strRedirectSSL="checkout.asp"
if scSSL="1" AND scIntSSLPage="1" then
strRedirectSSL=replace((scSslURL&"/"&scPcFolder&"/pc/checkout.asp"),"//","/")
strRedirectSSL=replace(strRedirectSSL,"https:/","https://")
strRedirectSSL=replace(strRedirectSSL,"http:/","http://")
end if
%>
<table width=
"<%=scprdTableWidth%>" border="0" cellspacing="0" cellpadding="2"> <tr valign="top"> <td> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr valign="top"> <td width="50%"><b><font face="<%=FFType%>" color="<%=FColor%>" size="2"> <%response.write dictLanguage.Item(Session("language")&"_showcart_3")%> </font></b></td> <td width="50%" align="right"> <table border="0" cellpadding="2"> <tr> <td> <a href="default.asp"><img src="<%=RSlayout("continueshop")%>" border="0"></a> </td> </tr> <tr> <td> <a href="<%=strRedirectSSL%>"><img src="<%=RSlayout("checkout")%>" border="0"></a></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td> <div> <form method="post" action="cRec.asp" name="recalculate"> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr> <td width="6%" bgcolor="<%=AColor%>"><font color="<%=AFColor%>" face="<%=FFType%>" size="2"> <%response.write dictLanguage.Item(Session("language")&"_showcart_4")%> </font></td> <td width="51%" bgcolor="<%=AColor%>"><font color="<%=AFColor%>" face="<%=FFType%>" size="2"> <%response.write dictLanguage.Item(Session("language")&"_showcart_6")%> </font></td> <td width="15%" align="center" nowrap bgcolor="<%=AColor%>"><font color="<%=AFColor%>" face="<%=FFType%>" size="2"> <%response.write dictLanguage.Item(Session("language")&"_showcart_8b")%> </font></td> <td width="15%" bgcolor="<%=AColor%>" align="center"><font color="<%=AFColor%>" face="<%=FFType%>" size="2"><%response.write dictLanguage.Item(Session("language")&"_showcart_8")%> </font></td> <td width="13%" bgcolor="<%=AColor%>"><img src="images/pc_clear.gif" width="1" height="1"></td> </tr><% dim totalRowWeight
totalRowWeight=0
Dim ProList(100,5)
for f=1 to pcCartIndex
ProList(f,0)=pcCartArray(f,0)
ProList(f,1)=pcCartArray(f,10)
ProList(f,3)=pcCartArray(f,2)
ProList(f,4)=0
if pcCartArray(f,10)=0 then%>
<tr> <td width="6%" height="27"> <font face="<%=FFType%>" color="<%=FColor%>" size="2"> <% 'Validate for multiple of N
query="select serviceSpec,pcprod_HideBTOPrice,pcprod_QtyValidate,pcprod_MinimumQty from products where idproduct=" & pcCartArray(f,0)
set rs=server.CreateObject("ADODB.RecordSet")
set rs=connTemp.execute(query)
IsBTO=rs("serviceSpec")
pcv_intHideBTOPrice=rs("pcprod_HideBTOPrice")
if isNULL(pcv_intHideBTOPrice) OR pcv_intHideBTOPrice="" then
pcv_intHideBTOPrice="0"
end if
pcv_intQtyValidate=rs("pcprod_QtyValidate")
if isNULL(pcv_intQtyValidate) OR pcv_intQtyValidate="" then
pcv_intQtyValidate="0"
end if
pcv_lngMinimumQty=rs("pcprod_MinimumQty")
if isNULL(pcv_lngMinimumQty) OR pcv_lngMinimumQty="" then
pcv_lngMinimumQty="0"
end if
set rs=nothing %>
<input class=iform type="text" name="Cant<%=f%>" size="4" value="<% response.write pcCartArray(f,2) %>" onBlur="checkproqty(this,<%=pcv_lngMinimumQty%>,<%if pcv_intQtyValidate<>"1" then%>0<%else%>1<%end if%>)"> </font> </td> <td width="51%" height="27"> <font face="<%=FFType%>" color="<%=FColor%>" size="2"> <a href="viewPrd.asp?idproduct=<%=pcCartArray(f,0)%>"><%response.write pcCartArray(f,1)%></a> </font> </td>
<% 'BTO ADDON-S
pBTOValues=0
if trim(pcCartArray(f,16))<>"" then
query="SELECT stringProducts, stringValues, stringCategories, stringQuantity, stringPrice FROM configSessions WHERE idconfigSession=" & trim(pcCartArray(f,16))
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if err.number <> 0 then
set rs=nothing
call closeDb()
response.redirect "techErr.asp?error="& Server.Urlencode("Error in viewCart.asp - Line 227")
end if
stringProducts=rs("stringProducts")
stringValues=rs("stringValues")
stringCategories=rs("stringCategories")
ArrProduct=Split(stringProducts, ",")
ArrValue=Split(stringValues, ",")
ArrCategory=Split(stringCategories, ",")
Qstring=rs("stringQuantity")
ArrQuantity=Split(Qstring,",")
Pstring=rs("stringPrice")
ArrPrice=split(Pstring,",")
set rs=nothing
if ArrProduct(0)="na" then
else
for i=lbound(ArrProduct) to (UBound(ArrProduct)-1)
if (CDbl(ArrValue(i))<>0) or ((ArrQuantity(i)-1<>0) and (ArrPrice(i)<>0)) then
if (ArrQuantity(i)-1)>=0 then
UPrice=(ArrQuantity(i)-1)*ArrPrice(i)
else
UPrice=0
end if
pBTOValues=pBTOValues+Cdbl((ArrValue(i)+UPrice)*pcCartArray(f,2))
end if
set rs=nothing
next
end if
End if
'BTO ADDON-E %>
<% dim pRowPrice, pRowWeight, pExtRowPrice
pRowPrice=Cdbl(pcCartArray(f,2) * pcCartArray(f,17))
pExtRowPrice=Cdbl(pcCartArray(f,2) * pcCartArray(f,17))-cdbl(pBTOvalues)
if pcCartArray(f,20)=0 then
pRowWeight=pcCartArray(f,2)*pcCartArray(f,6)
else
pRowWeight=0
end if
totalRowWeight=totalRowWeight+pRowWeight %>
<td width="15%" height="27" align="center"> <font face="<%=FFType%>" color="<%=FColor%>" size="2"> <%if pcv_intHideBTOPrice<>"1" then%> <%=scCurSign & extmoney(pcCartArray(f,17)-cdbl(cdbl(pBTOvalues)/pcCartArray(f,2)))%> <%end if%> </font> </td> <td width="15%" align="right"> <font size="2" face="<%=FFType%>" color="<%=FColor%>"> <% response.write scCurSign & money(pExtRowPrice) %> </font> </td> <td width="13%" height="27"> <div align="right"><font size="2" face="<%=FFType%>" color="<%=FColor%>"> <a href="cRemv.asp?pcCartIndex=<%response.write f%>"><img src="<%=RSlayout("remove")%>" border="0"></a> </font></div> <%if (IsBTO=-1) and pcCartArray(f,16)="" then%> <br> <div align="right"><font size="2" face="<%=FFType%>" color="<%=FColor%>"> <a href="Reconfigure.asp?pcCartIndex=<%=f%>"><img src="<%=rslayout("reconfigure")%>" border="0" alt="Reconfigure <%=pcCartArray(f,1)%>"></a> </font></div> <%end if%> </td> </tr>
<% 'BTO ADDON-S
if trim(pcCartArray(f,16))<>"" then
query="SELECT stringProducts, stringValues, stringCategories, stringQuantity, stringPrice FROM configSessions WHERE idconfigSession=" & trim(pcCartArray(f,16))
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if err.number <> 0 then
set rs=nothing
call closeDb()
response.redirect "techErr.asp?error="& Server.Urlencode("Error in viewCart.asp - Line 305")
end if
stringProducts=rs("stringProducts")
stringValues=rs("stringValues")
stringCategories=rs("stringCategories")
ArrProduct=Split(stringProducts, ",")
ArrValue=Split(stringValues, ",")
ArrCategory=Split(stringCategories, ",")
Qstring=rs("stringQuantity")
ArrQuantity=Split(Qstring,",")
Pstring=rs("stringPrice")
ArrPrice=split(Pstring,",")
set rs=nothing %>
<tr valign="top">
<td height="11" width="6%"> </td> <td height="11" colspan="3" bgcolor="<%=vBTOvcBGColor%>"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <% if ArrProduct(0)="na" then %> <tr> <td colspan="2"><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <b> <%response.write bto_dictLanguage.Item(Session("language")&"_viewcart_2")%> </b></font></td> </tr> <% else %> <tr> <td colspan="2"><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <b> <%response.write bto_dictLanguage.Item(Session("language")&"_viewcart_1")%> </b></font></td> </tr> <% for i=lbound(ArrProduct) to (UBound(ArrProduct)-1)
query="SELECT categories.categoryDesc, products.description FROM categories, products WHERE (((categories.idCategory)="&ArrCategory(i)&") AND ((products.idProduct)="&ArrProduct(i)&"))"
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
strCategoryDesc=rs("categoryDesc")
strDescription=rs("description")
set rs=nothing
query="SELECT displayQF FROM configSpec_Products WHERE configProduct="&ArrProduct(i) & " and specProduct=" & pcCartArray(f,0)
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
btDisplayQF=rs("displayQF")
set rs=nothing %>
<tr valign="top"> <td width="30%"><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <%=strCategoryDesc%>:</font></td> <td width="70%"> <table width=100% border="0" cellspacing="0" cellpadding="0"> <tr> <td width=75%><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"><%=strDescription%> <%if btDisplayQF=True then%>
-
<b>QTY: <%=ArrQuantity(i)%></b> <%end if%></font></td> <td width=25%><p align="right"> <font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <%if (CDbl(ArrValue(i))<>0) or ((ArrQuantity(i)-1<>0) and (ArrPrice(i)<>0)) thenif (ArrQuantity(i)-1)>=0 then
UPrice=(ArrQuantity(i)-1)*ArrPrice(i)
else
UPrice=0
end if %>
<%=scCurSign & money(Cdbl((ArrValue(i)+UPrice)*pcCartArray(f,2)))%> <%end if%> </font></td> </tr> </table> </td> </tr> <% next %> <% end if %> </table> </td> <td width="13%"><div align="right"><font size="2" face="<%=FFType%>" color="<%=FColor%>"><a href="Reconfigure.asp?pcCartIndex=<%=f%>"><img src="<%=rslayout("reconfigure")%>" border="0" alt="Reconfigure <%=pcCartArray(f,1)%>"></a></font></div></td> </tr> <% End if'BTO ADDON-E %>
<% ' show product options, if any
if trim(pcCartArray(f,4))<>"" or trim(pcCartArray(f,8))<>"" then %>
<tr valign="top"> <td width="6%"> </td> <td colspan="3"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <% if trim(pcCartArray(f,4))<>"" then %> <tr> <td width="67%"> <font size="2" face="<%=FFType%>" color="<%=FColor%>"> <% response.write pcCartArray(f,4) %></font></td> <td align="right" width="33%"><font size="2" face="<%=FFType%>" color="<%=FColor%>"> <% if pcCartArray(f,25)="" or pcCartArray(f,25)=0 thenresponse.write " "
else
tempPriceA=pcCartArray(f,25)
%>
<table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left" width="50%"><font color="<%=FColor%>" face="<%=FFType%>" size="2"><%=scCurSign&money(tempPriceA)%></font></td> <td align="right" width="50%"><font color="<%=FColor%>" face="<%=FFType%>" size="2"> <%Dim tApricetAprice=(pcCartArray(f,25)*Cdbl(pcCartArray(f,2)))
response.write scCurSign&money(tAprice) %>
</font></td> </tr> </table> <% end if %> </font> </td> </tr> <% end if
if trim(pcCartArray(f,8))<>"" then %>
<tr> <td width="67%"> <font color="<%=FColor%>" face="<%=FFType%>" size="2"> <% response.write pcCartArray(f,8) %></font></td> <td align="right" width="33%"> <% if pcCartArray(f,27)="" or pcCartArray(f,27)=0 thenresponse.write " "
else
tempPriceB=pcCartArray(f,27) %>
<table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr><td align="left" width="50%"><font color="<%=FColor%>" face="<%=FFType%>" size="2"><%=scCurSign&money(tempPriceB)%></font></td> <td align="right" width="50%"><font color="<%=FColor%>" face="<%=FFType%>" size="2"> <% Dim tBpricetBprice=(pcCartArray(f,27)*Cdbl(pcCartArray(f,2)))
response.write scCurSign&money(tBprice) %>
</font></td></tr></table> <% end if %> </font></td> </tr> <% end if %><% 'if there are product options, show link to edit them
if trim(pcCartArray(f,16))="" then %>
<tr valign="top"> <td colspan="2"><img src="images/cleardot.gif" width="1" height="2"></td> </tr> <tr valign="top"> <td colspan="3"> <a href="viewPrd.asp?idproduct=<%=pcCartArray(f,0)%>&index=<%=f%>&imode=updOrd"><font size="1" face="<%=FFType%>" color="<%=FColor%>"><%response.write dictLanguage.Item(Session("language")&"_showcart_21")%></font></a></td> </tr> <% end if %></table> </td> <td width="13%"> </td> </tr> <% End if
pRowPrice=pRowPrice + Cdbl(pcCartArray(f,2) * pcCartArray(f,5)) %>
<% 'if there are custom input fields, show them here
if trim(pcCartArray(f,21))<>"" then %>
<tr> <td width="6%"> </td> <td colspan="3" align="right"><table width="99%" cellpadding="4" cellspacing="0" border="0"><tr><td><font size="2" face="<%=FFType%>" color="<%=FColor%>"><% response.write replace(pcCartArray(f,21),"''","'") %></font></td></tr></table></td> <td width="13%"> </td> </tr> <% End if %> <% 'if items quantities discounts apply to this product, show the total applied amount hereif pcCartArray(f,16)<>"" then
itemsDiscounts=0
for i=lbound(ArrProduct) to (UBound(ArrProduct)-1)
query="select quantityFrom, quantityUntil, discountperUnit, percentage, discountperWUnit from discountsPerQuantity where IDProduct=" & ArrProduct(i)
set rs=server.CreateObject("ADODB.RecordSet")
set rs=connTemp.execute(query)
TempDiscount=0
do while not rs.eof
QFrom=rs("quantityFrom")
QTo=rs("quantityUntil")
DUnit=rs("discountperUnit")
QPercent=rs("percentage")
DWUnit=rs("discountperWUnit")
if (DWUnit=0) and (DUnit>0) then
DWUnit=DUnit
end if
if (DUnit=0) and (DWUnit>0) then
DUnit=DWUnit
end if
TempD1=0
if (clng(ArrQuantity(i)*pcCartArray(f,2))>=clng(QFrom)) and (clng(ArrQuantity(i)*pcCartArray(f,2))<=clng(QTo)) then
if QPercent="-1" then
if session("customerType")=1 then
TempD1=ArrQuantity(i)*pcCartArray(f,2)*ArrPrice(i)*0.01*DWUnit
else
TempD1=ArrQuantity(i)*pcCartArray(f,2)*ArrPrice(i)*0.01*DUnit
end if
else
if session("customerType")=1 then
TempD1=ArrQuantity(i)*pcCartArray(f,2)*DWUnit
else
TempD1=ArrQuantity(i)*pcCartArray(f,2)*DUnit
end if
end if
end if
TempDiscount=TempDiscount+TempD1
rs.movenext
loop
set rs=nothing
itemsDiscounts=ItemsDiscounts+TempDiscount
next
if ItemsDiscounts>0 then
pcCartArray(f,30)=ItemsDiscounts
pRowPrice=pRowPrice-ItemsDiscounts %>
<tr> <td width="6%"> </td> <td colspan="2" align="right"><table width="99%" cellpadding="0" cellspacing="0" border="0"><tr><td><font color="<%=FColor%>" face="<%=FFType%>" size="2"><%response.write dictLanguage.Item(Session("language")&"_showcart_23")%></font></td></tr></table></td> <td width="15%" align="right" nowrap><font color="<%=FColor%>" face="<%=FFType%>" size="2">- <% response.write scCurSign & money(ItemsDiscounts) %> </font></td> <td width="13%"> </td> </tr> <% elsepcCartArray(f,30)=0
end if
End if%>
<% 'BTO Additional Chargesif trim(pcCartArray(f,16))<>"" then
query="SELECT stringCProducts, stringCValues, stringCCategories FROM configSessions WHERE idconfigSession=" & trim(pcCartArray(f,16))
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if err.number <> 0 then
set rs=nothing
call closeDb()
response.redirect "techErr.asp?error="& Server.Urlencode("Error in viewCart.asp - Line 530")
end if
stringCProducts=rs("stringCProducts")
stringCValues=rs("stringCValues")
stringCCategories=rs("stringCCategories")
ArrCProduct=Split(stringCProducts, ",")
ArrCValue=Split(stringCValues, ",")
ArrCCategory=Split(stringCCategories, ",")
set rs=nothing %>
<% if ArrCProduct(0)<>"na" then%> <tr valign="top"> <td height="11" width="6%"> </td> <td height="11" colspan="3" bgcolor="<%=vBTOvcBGColor%>"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <% pRowPrice=pRowPrice+CDbl(pcCartArray(f,31)) %> <tr> <td><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <b> <%response.write bto_dictLanguage.Item(Session("language")&"_viewcart_3")%> </b></font></td> <td> </td> </tr> <% for i=lbound(ArrCProduct) to (UBound(ArrCProduct)-1)
query="SELECT categories.categoryDesc, products.description FROM categories, products WHERE (((categories.idCategory)="&ArrCCategory(i)&") AND ((products.idProduct)="&ArrCProduct(i)&"))"
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
strCategoryDesc=rs("categoryDesc")
strDescription=rs("description")
set rs=nothing %>
<tr valign="top"> <td width="30%"><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <%=strCategoryDesc%>:</font></td> <td width="70%"> <table width=100% border="0" cellspacing="0" cellpadding="0"> <tr> <td width=75%><font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"><%=strDescription%></font></td> <td width=25%><p align="right"> <font size="<%=iBTOvcFSize%>" face="<%=FFType%>" color="<%=vBTOvcFColor%>"> <%if (CDbl(ArrCValue(i))>0) then%> <%=scCurSign & money(ArrCValue(i))%> <%end if%> </font></td> </tr> </table> </td> </tr> <% next %> </table> </td> <td width="13%"><div align="right"><font size="2" face="<%=FFType%>" color="<%=FColor%>"><a href="RePrdAddCharges.asp?pcCartIndex=<%=f%>"><img src="<%=rslayout("reconfigure")%>" border="0" alt="Reconfigure <%=pcCartArray(f,1)%>"></a></font></div></td> </tr> <% end if %> <% End if
'BTO Additional Charges %>
<% 'if quantity discounts apply to this product, show the total applied amount here
if trim(pcCartArray(f,15))<>"" AND trim(pcCartArray(f,15))>0 then
pRowPrice=pRowPrice-CDbl(pcCartArray(f,15))
%>
<tr> <td width="6%"> </td> <td colspan="2" align="right"><table width="99%" cellpadding="0" cellspacing="0" border="0"><tr><td><font color="<%=FColor%>" face="<%=FFType%>" size="2"> <a href="javascript:win('priceBreaks.asp?idproduct=<%=pcCartArray(f,0)%>')"><%response.write dictLanguage.Item(Session("language")&"_showcart_20")%></a><%response.write dictLanguage.Item(Session("language")&"_showcart_20b")%></font></td></tr></table></td> <td width="15%" align="right" nowrap><font color="<%=FColor%>" face="<%=FFType%>" size="2">- <% response.write scCurSign & money(pcCartArray(f,15)) %> </font></td> <td width="13%"> </td> </tr> <% End if
if pExtRowPrice<>pRowPrice then %>
<tr> <td width="6%"> </td> <td colspan="2" align="right"><font color="<%=FColor%>" face="<%=FFType%>" size="2"><%response.write dictLanguage.Item(Session("language")&"_showcart_22")%></font></td> <td width="15%" align="right"><font size="2" face="<%=FFType%>" color="<%=FColor%>"> <% response.write scCurSign & money(pRowPrice) %> </font></td> <td width="13%"> </td> </tr> <% end if
ProList(f,2)=pRowPrice %>
<tr> <td colspan="5" height="5"><hr width="100%" size="1" noshade color="#e1e1e1"></td> </tr> <% total=total + pRowPriceif Cint(pcCartArray(f,9))>totalDeliveringTime then
totalDeliveringTime=Cint(pcCartArray(f,9))
end if
end if ' item deleted
next %>
</table><% CatDiscTotal=0
query="SELECT pcCD_idCategory as IDCat FROM pcCatDiscounts group by pcCD_idCategory"
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
Do While not rs.eof
CatSubQty=0
CatSubTotal=0
CatSubDiscount=0
For f=1 to pcCartIndex
if (ProList(f,1)=0) and (ProList(f,4)=0) then
query="select idproduct from categories_products where idcategory=" & rs("IDCat") & " and idproduct=" & ProList(f,0)
set rstemp=server.CreateObject("ADODB.RecordSet")
set rstemp=connTemp.execute(query)
if not rstemp.eof then
CatSubQty=CatSubQty+ProList(f,3)
CatSubTotal=CatSubTotal+ProList(f,2)
ProList(f,4)=1
end if
set rstemp=nothing
end if
Next
if CatSubQty>0 then
query="SELECT pcCD_discountPerUnit,pcCD_discountPerWUnit,pcCD_percentage,pcCD_baseproductonly FROM pcCatDiscounts WHERE pcCD_idCategory=" & rs("IDCat") & " AND pcCD_quantityFrom<=" &CatSubQty& " AND pcCD_quantityUntil>=" &CatSubQty
set rstemp=server.CreateObject("ADODB.RecordSet")
set rstemp=conntemp.execute(query)
if not rstemp.eof then
' there are quantity discounts defined for that quantity
pDiscountPerUnit=rstemp("pcCD_discountPerUnit")
pDiscountPerWUnit=rstemp("pcCD_discountPerWUnit")
pPercentage=rstemp("pcCD_percentage")
pbaseproductonly=rstemp("pcCD_baseproductonly")
set rstemp=nothing
if session("customerType")<>1 then 'customer is a normal user
if pPercentage="0" then
CatSubDiscount=pDiscountPerUnit*CatSubQty
else
CatSubDiscount=(pDiscountPerUnit/100) * CatSubTotal
end if
else 'customer is a wholesale customer
if pPercentage="0" then
CatSubDiscount=pDiscountPerWUnit*CatSubQty
else
CatSubDiscount=(pDiscountPerWUnit/100) * CatSubTotal
end if
end if
end if
end if
CatDiscTotal=CatDiscTotal+CatSubDiscount
rs.MoveNext
loop
set rs=nothing
total=total-CatDiscTotal%>
<table width="<%=scprdTableWidth%>" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="0" valign="top"><div align="left"> <table border="0" cellpadding="2"> <tr> <td> <input type="image" name="Submit" src="<%=RSlayout("recalculate")%>" border="0"> </td> </tr> <tr> <td> <a href="<%=strRedirectSSL%>"><img src="<%=RSlayout("checkout")%>" border="0"></a></td> </tr> </table> </div></td> <td width="0" valign="top"><div align="right"><font face="<%=FFType%>" color="<%=FColor%>" size="2"> <%if CatDiscTotal>0 then%> <%response.write dictLanguage.Item(Session("language")&"_catdisc_1")%> <% response.write scCurSign & money(CatDiscTotal) %><br><br> <%end if%> <b><%response.write dictLanguage.Item(Session("language")&"_showcart_12")%> <% response.write scCurSign & money(total) %></b></font></div></td> </tr> </table><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2"><hr width="100%" size="1" noshade color="#e1e1e1"></td> </tr> <% if scShowCartWeight="-1" then %> <tr> <td width="57%"><font face="<%=FFType%>" color="<%=FColor%>" size="2"> <% if scShipFromWeightUnit="KGS" then
pKilos=Int(totalRowWeight/1000)
pWeight_g=totalRowWeight-(pKilos*1000)
%>
<b><%response.write ship_dictLanguage.Item(Session("language")&"_viewCart_a")%></b> <%=pKilos&" kg "%> <% if pWeight_g>0 thenresponse.write pWeight_g&" g"
end if %>
<% elsepPounds=Int(totalRowWeight/16)
pWeight_oz=totalRowWeight-(pPounds*16)
%>
<b><%response.write ship_dictLanguage.Item(Session("language")&"_viewCart_a")%></b> <%=pPounds&" lbs. "%> <% if pWeight_oz>0 thenresponse.write pWeight_oz&" oz."
end if %>
<% end if %></font></td> <td width="43%"> </td> </tr> <% end if %> <% if iShipService=0 thenif scShowEstimateLink="-1" then %>
<tr> <td colspan="2"><a href="javascript:win('estimateShipCost.asp')"><font face="<%=FFType%>" color="<%=FColor%>" size="2"><%response.write ship_dictLanguage.Item(Session("language")&"_viewCart_b")%></font></a></td> </tr> <% end ifend if %>
</table><br> </form> </div>
<%if session("specialdiscount")<>"" then%> <font face="<%=FFType%>" color="<%=FColor%>" size="2"><b>Your entered discount code: <%=session("specialdiscount")%></b><br>
This code will be used when you checkout.
</font> <%end if%> </td> </tr> <% query= "SELECT cs_status,cs_showprod,cs_showcart,cs_showimage,crossSellText,cs_CartViewCnt FROM crossSelldata WHERE id=1;"set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
dim scCS, cs_showprod, cs_showcart, cs_showimage, crossSellText
scCS=rs("cs_status")
cs_showprod=rs("cs_showprod")
cs_showcart=rs("cs_showcart")
cs_showimage=rs("cs_showimage")
crossSellText=rs("crossSellText")
cs_ViewCnt=rs("cs_CartViewCnt")
'check if there are items for cross sell in the database
pidproduct=pcCartArray(pcCartIndex,0)
query= "SELECT * FROM cs_relationships WHERE idproduct="&pidProduct
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if NOT rs.eof then %>
<% if scCS=-1 AND cs_showcart="-1" then%> <tr> <td> <hr width="100%" size="1" noshade color="#e1e1e1"> <font face="<%=FFType%>" color="<%=FColor%>" size="2"><%=crossSellText%></font> </td> </tr> <tr> <td> <% if cs_showImage="-1" then %> <!--#include file="cs_img.asp"--> <% else %> <!--#include file="cs.asp"--> <% end if %> </td> </tr> <% end ifset rs=nothing %>
<% end if %>
</table>
<% call closedb() %>
<%Session("pcCartSession")=pcCartArray%>
<!--#include file="footer.asp"-->