<% '// START 1st Row - Table Headers %>
<%response.write dictLanguage.Item(Session("language")&"_showcart_4")%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_6")%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_8b")%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_8")%>
<%if session("Cust_GW")="1" then%><%response.write dictLanguage.Item(Session("language")&"_showcart_24")%><%end if%>
<% '// END 1st Row - Table Headers %>
<% dim totalRowWeight
totalRowWeight=0
pcv_SpecialServer=0
if InStr(Cstr(10/3),",")>0 then
pcv_SpecialServer=1
for f=1 to pcCartIndex
for n=0 to 34
if Instr(pcCartArray(f,n),".")>0 then
if IsNumeric(pcCartArray(f,n)) then
pcCartArray(f,n)=replace(pcCartArray(f,n),".",",")
end if
end if
next
next
else
if scDecSign="," then
pcv_SpecialServer=0
for f=1 to pcCartIndex
for n=0 to 34
if Instr(pcCartArray(f,n),",")>0 then
if IsNumeric(pcCartArray(f,n)) then
pcCartArray(f,n)=replace(pcCartArray(f,n),",",".")
end if
end if
next
next
end if
end if
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%>
<% '// START 2nd Row - Main Product Data %>
<% 'Validate for multiple of N
'APP-S
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
pcv_tmpPPrd1=pcv_tmpPPrd(ubound(pcv_tmpPPrd))
else
pcv_tmpPPrd1=pcCartArray(f,0)
end if
query="select serviceSpec,pcprod_HideBTOPrice,pcprod_QtyValidate,pcprod_MinimumQty from products where idproduct=" & pcv_tmpPPrd1
'APP-E
set rs=server.CreateObject("ADODB.RecordSet")
set rs=connTemp.execute(query)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rs=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
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 %>
<%'GGG Add-on start
gRemain=0
if (pcCartArray(f,33)<>"") and (pcCartArray(f,33)<>"0") then
query="select pcEP_Qty,pcEP_HQty from pcEvProducts where pcEP_ID=" & pcCartArray(f,33)
set rsG=connTemp.execute(query)
if not rsG.eof then
gRemain=cdbl(rsG("pcEP_Qty"))-cdbl(rsG("pcEP_HQty"))
end if
set rsG=nothing
end if
'APP-S
If Session("Cust_BuyGift")<>"" Then
'//Get Parent
query="SELECT products.pcprod_ParentPrd, pcEvProducts.pcEP_IDEvent, products.idProduct, pcEvProducts.pcEP_ID FROM pcEvProducts INNER JOIN products ON pcEvProducts.pcEP_IDProduct = products.idProduct WHERE (((pcEvProducts.pcEP_IDEvent)=" & session("Cust_IDEvent") & " ) AND ((pcEvProducts.pcEP_ID)="&pcCartArray(f,33)&"));"
set rsParId=Server.CreateObject("ADODB.RecordSet")
set rsParId=connTemp.execute(query)
gParentPrdId=rsParId("pcprod_ParentPrd")
End If
'APP-E
'GGG Add-on end%>
<% '// Set Quantity field to transparent if it's a child (Cross Sell) or it's a Finalized Quote
pcv_FinalizedQuote=0
if Instr(session("sf_FQuotes"),"****" & pcCartArray(f,0) & "****")>0 then
pcv_FinalizedQuote=1
end if
if trim(pcCartArray(f,27))="" then
pcCartArray(f,27)=0
end if
if trim(pcCartArray(f,28))="" then
pcCartArray(f,28)=0
end if
if (pcCartArray(f,27)>0) AND (pcCartArray(f,28)>0) or (pcv_FinalizedQuote=1) then %>
<% else %>
0<%else%>1<%end if%>,<%if session("Cust_IDEvent")<>"" then%><%=gRemain%><%else%>0<%end if%>)" onkeypress="return handleEnter(this, event)">
<%
end if
%>
<% ' Get product image and sku
query="SELECT sku,smallImageUrl,imageUrl FROM products WHERE idProduct=" & pcCartArray(f,0)
set rsImg=Server.CreateObject("ADODB.Recordset")
set rsImg=conntemp.execute(query)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rsImg=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
pcvStrSku = rsImg("sku")
pcvStrSmallImage = trim(rsImg("smallImageUrl"))
'APP-S
if (pcCartArray(f,32)<>"") then
pcvStrSmallImage = trim(rsImg("imageUrl"))
end if
if pcvStrSmallImage = "" or pcvStrSmallImage = "no_image.gif" then
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
pcv_tmpPPrdTemp=pcv_tmpPPrd(ubound(pcv_tmpPPrd))
query="SELECT smallImageUrl FROM products WHERE idProduct=" & pcv_tmpPPrdTemp
set rsImgParent=Server.CreateObject("ADODB.Recordset")
set rsImgParent=conntemp.execute(query)
if err.number<>0 then
call LogErrorToDatabase()
set rsImgParent=nothing
call closedb()
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
pcvStrSmallImage=rsImgParent("smallImageUrl")
set rsImgParent=nothing
end if
end if
'APP-E
if pcvStrSmallImage = "" or pcvStrSmallImage = "no_image.gif" then
pcvStrSmallImage = "hide"
end if
set rsImg = nothing
' End get product image
%>
<%
'// Below we setup the image and product name links
'// If this is a Gift Registry then we use different links
%>
<% If Session("Cust_BuyGift")="" Then %>
<% if pcvStrSmallImage = "hide" then %>
<% else
'APP-S
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
%>
onmouseover="javascript:document.getPrd.idproduct.value='<%=pcCartArray(f,0)%>'; sav_callxml='1'; return runXML1('prd_<%=pcCartArray(f,0)%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>>
">
<% else %>
onmouseover="javascript:document.getPrd.idproduct.value='<%=pcCartArray(f,0)%>'; sav_callxml='1'; return runXML1('prd_<%=pcCartArray(f,0)%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>>
">
<%end if
'APP-E%>
<% end if %>
<% Else %>
<% if pcvStrSmallImage = "hide" then %>
<% else %>
onmouseover="javascript:document.getPrd.idproduct.value='<%=pcCartArray(f,0)%>'; sav_callxml='1'; return runXML1('prd_<%=pcCartArray(f,0)%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>>
">
<% end if %>
<% End If %>
<% If Session("Cust_BuyGift")="" Then
'APP-S
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
%>
onmouseover="javascript:document.getPrd.idproduct.value='<%=pcCartArray(f,0)%>'; sav_callxml='1'; return runXML1('prd_<%=pcCartArray(f,0)%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>><%response.write pcCartArray(f,1)%> (<%=pcvStrSku%>)
<%response.write dictLanguage.Item(Session("language")&"_showcart_21")%>
<%else%>
onmouseover="javascript:document.getPrd.idproduct.value='<%=pcCartArray(f,0)%>'; sav_callxml='1'; return runXML1('prd_<%=pcCartArray(f,0)%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>><%response.write pcCartArray(f,1)%> (<%=pcvStrSku%>)
<%end if
'APP-E%>
<% Else %>
onmouseover="javascript:document.getPrd.idproduct.value='<%=pcCartArray(f,0)%>'; sav_callxml='1'; return runXML1('prd_<%=pcCartArray(f,0)%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>><%response.write pcCartArray(f,1)%> (<%=pcvStrSku%>)
<% End If %>
<% '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
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rs=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
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)
'APP-S
query="SELECT pcprod_ParentPrd FROM Products WHERE idproduct=" & ArrProduct(i) & ";"
set rsQ=connTemp.execute(query)
if not rsQ.eof then
pcv_ParentPrd=rsQ("pcprod_ParentPrd")
end if
set rsQ=nothing
if pcv_ParentPrd>"0" then
else
pcv_ParentPrd=ArrProduct(i)
end if
'APP-E
query="SELECT pcprod_minimumqty FROM Products WHERE idproduct=" & pcv_ParentPrd & ";"
set rsQ=connTemp.execute(query)
tmpMinQty=1
if not rsQ.eof then
tmpMinQty=rsQ("pcprod_minimumqty")
if IsNull(tmpMinQty) or tmpMinQty="" then
tmpMinQty=1
else
if tmpMinQty="0" then
tmpMinQty=1
end if
end if
end if
set rsQ=nothing
tmpDefault=0
query="SELECT cdefault FROM configSpec_products WHERE specProduct=" & pcCartArray(f,0) & " AND configProduct=" & pcv_ParentPrd & " AND cdefault<>0;"
set rsQ=connTemp.execute(query)
if not rsQ.eof then
tmpDefault=rsQ("cdefault")
if IsNull(tmpDefault) or tmpDefault="" then
tmpDefault=0
else
if tmpDefault<>"0" then
tmpDefault=1
end if
end if
end if
set rsQ=nothing
if pcv_SpecialServer=1 then
ArrValue(i)=replace(ArrValue(i),".",",")
ArrPrice(i)=replace(ArrPrice(i),".",",")
end if
if (ccur(ArrValue(i))<>0) or ((((ArrQuantity(i)-clng(tmpMinQty)<>0) AND (tmpDefault=1)) OR ((ArrQuantity(i)-1<>0) AND (tmpDefault=0))) and (ArrPrice(i)<>0)) then
if (ArrQuantity(i)-clng(tmpMinQty))>=0 then
if tmpDefault=1 then
UPrice=(ArrQuantity(i)-clng(tmpMinQty))*ArrPrice(i)
else
UPrice=(ArrQuantity(i)-1)*ArrPrice(i)
end if
else
UPrice=0
end if
pBTOValues=pBTOValues+ccur((ArrValue(i)+UPrice)*pcCartArray(f,2))
end if
set rs=nothing
next
end if
End if
'BTO ADDON-E %>
<% dim pRowPrice, pRowWeight, pExtRowPrice
pRowPrice=ccur(pcCartArray(f,2) * pcCartArray(f,17))
pExtRowPrice=ccur(pcCartArray(f,2) * pcCartArray(f,17))-ccur(pBTOvalues)
if pcCartArray(f,20)=0 then
pRowWeight=pcCartArray(f,2)*pcCartArray(f,6)
else
pRowWeight=0
end if
totalRowWeight=totalRowWeight+pRowWeight %>
<%if pcv_intHideBTOPrice<>"1" then%>
<% if pcCartArray(f,17) > 0 then %>
<%=scCurSign & money(pcCartArray(f,17)-ccur(ccur(pBTOvalues)/pcCartArray(f,2)))%>
<% end if %>
<%end if%>
<% if pExtRowPrice > 0 then response.write(scCurSign & money(pExtRowPrice)) end if %>
<%if session("Cust_GW")="1" then
'APP-S
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
pcv_tmpPPrd1=pcv_tmpPPrd(ubound(pcv_tmpPPrd))
else
pcv_tmpPPrd1=pcCartArray(f,0)
end if
query="select pcPE_IDProduct from pcProductsExc where pcPE_IDProduct=" & pcv_tmpPPrd1
'APP-E
set rs1=connTemp.execute(query)
if rs1.eof then%>
"") and (pcCartArray(f,34)<>"0") then%>checked<%end if%> class="clearBorder">
<%else%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_25")%>
<%end if%>
<%end if%>
<% '// Show Remove Button if it's NOT a Required child (Cross Sell) %>
<% if (pcCartArray(f,12)<>-2) then %>
" alt="<%=dictLanguage.Item(Session("language")&"_altTag_13")%>">
<% end if %>
<%if (IsBTO=-1) and pcCartArray(f,16)="" and pcv_FinalizedQuote=0 then
call opendb()
queryQ="SELECT TOP 1 configProduct FROM configSpec_products WHERE specProduct=" & pcCartArray(f,0) & ";"
set rsQ=connTemp.execute(queryQ)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rsQ=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
if not rsQ.eof then%>
" alt="Reconfigure <%=pcCartArray(f,1)%>">
<%End if
set rsQ=nothing%>
<%end if%>
<% '// END 2nd Row - Main Product Data %>
<% '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
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rs=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
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 %>
<% '// START 3nd Row - BTO Product Details %>
<% if ArrProduct(0)="na" then %>
<%response.write bto_dictLanguage.Item(Session("language")&"_viewcart_2")%>
<% else %>
<%response.write bto_dictLanguage.Item(Session("language")&"_viewcart_1")%>
<% for i=lbound(ArrProduct) to (UBound(ArrProduct)-1)
if pcv_SpecialServer=1 then
ArrValue(i)=replace(ArrValue(i),".",",")
ArrPrice(i)=replace(ArrPrice(i),".",",")
end if
'APP-S
query="SELECT categories.categoryDesc, products.description,products.pcProd_ParentPrd FROM categories, products WHERE (((categories.idCategory)="&ArrCategory(i)&") AND ((products.idProduct)="&ArrProduct(i)&"))"
'APP-E
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rs=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
strCategoryDesc=rs("categoryDesc")
strDescription=rs("description")
'APP-S
intParentPrd=rs("pcProd_ParentPrd")
if intParentPrd>"0" then
else
intParentPrd=ArrProduct(i)
end if
'APP-E
set rs=nothing
'APP-S
query="SELECT displayQF FROM configSpec_Products WHERE configProduct="& intParentPrd & " and specProduct=" & pcCartArray(f,0)
'APP-E
set rs=server.CreateObject("ADODB.RecordSet")
set rs=conntemp.execute(query)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rs=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
btDisplayQF=rs("displayQF")
set rs=nothing
query="SELECT pcprod_minimumqty FROM Products WHERE idproduct=" & intParentPrd & ";"
set rsQ=connTemp.execute(query)
tmpMinQty=1
if not rsQ.eof then
tmpMinQty=rsQ("pcprod_minimumqty")
if IsNull(tmpMinQty) or tmpMinQty="" then
tmpMinQty=1
else
if tmpMinQty="0" then
tmpMinQty=1
end if
end if
end if
set rsQ=nothing
tmpDefault=0
query="SELECT cdefault FROM configSpec_products WHERE specProduct=" & pcCartArray(f,0) & " AND configProduct=" & intParentPrd & " AND cdefault<>0;"
set rsQ=connTemp.execute(query)
if not rsQ.eof then
tmpDefault=rsQ("cdefault")
if IsNull(tmpDefault) or tmpDefault="" then
tmpDefault=0
else
if tmpDefault<>"0" then
tmpDefault=1
end if
end if
end if
set rsQ=nothing %>
<%=strCategoryDesc%>:
<%if btDisplayQF=True AND clng(ArrQuantity(i))>1 then%>(<%=ArrQuantity(i)%>) <%end if%>
<%=strDescription%>
<%if (ccur(ArrValue(i))<>0) or ((((ArrQuantity(i)-clng(tmpMinQty)<>0) AND (tmpDefault=1)) OR ((ArrQuantity(i)-1<>0) AND (tmpDefault=0))) and (ArrPrice(i)<>0)) then
if (ArrQuantity(i)-clng(tmpMinQty))>=0 then
if tmpDefault=1 then
UPrice=(ArrQuantity(i)-clng(tmpMinQty))*ArrPrice(i)
else
UPrice=(ArrQuantity(i)-1)*ArrPrice(i)
end if
else
UPrice=0
end if %>
<%=scCurSign & money(ccur((ArrValue(i)+UPrice)*pcCartArray(f,2)))%>
<%else
if tmpDefault=1 then%>
<%=dictLanguage.Item(Session("language")&"_defaultnotice_1")%>
<%end if
end if%>
<% next %>
<% end if %>
<%if pcv_FinalizedQuote=0 then%>
<%call opendb()
queryQ="SELECT TOP 1 configProduct FROM configSpec_products WHERE specProduct=" & pcCartArray(f,0) & ";"
set rsQ=connTemp.execute(queryQ)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rsQ=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
if not rsQ.eof then%>
" alt="Reconfigure <%=pcCartArray(f,1)%>">
<%End if
set rsQ=nothing%>
<%end if%>
<% '// END 3nd Row - BTO Product Details %>
<% End if
'BTO ADDON-E %>
<% '// START 4th Row - Product Options %>
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' START: SHOW PRODUCT OPTIONS
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim pcv_strOptionsArray, pcv_intOptionLoopSize, pcv_intOptionLoopCounter, tempPrice, tAprice
Dim pcArray_strOptionsPrice, pcArray_strOptions, pcArray_strSelectedOptions
pcv_strOptionsArray = trim(pcCartArray(f,4))
if len(pcv_strOptionsArray)>0 then %>
<%
'#####################
' START LOOP
'#####################
'// Generate Our Local Arrays from our Stored Arrays
' Column 11) pcv_strSelectedOptions '// Array of Individual Selected Options Id Numbers
pcArray_strSelectedOptions = ""
pcArray_strSelectedOptions = Split(trim(pcCartArray(f,11)),chr(124))
' Column 25) pcv_strOptionsPriceArray '// Array of Individual Options Prices
pcArray_strOptionsPrice = ""
pcArray_strOptionsPrice = Split(trim(pcCartArray(f,25)),chr(124))
' Column 4) pcv_strOptionsArray '// Array of Product "option groups: options"
pcArray_strOptions = ""
pcArray_strOptions = Split(trim(pcv_strOptionsArray),chr(124))
' Get Our Loop Size
pcv_intOptionLoopSize = 0
pcv_intOptionLoopSize = Ubound(pcArray_strSelectedOptions)
' Start in Position One
pcv_intOptionLoopCounter = 0
' Display Our Options
For pcv_intOptionLoopCounter = 0 to pcv_intOptionLoopSize %>
<%=pcArray_strOptions(pcv_intOptionLoopCounter) %>
<% tempPrice = pcArray_strOptionsPrice(pcv_intOptionLoopCounter)
if tempPrice="" or tempPrice=0 then
response.write " "
else %>
<%=scCurSign&money(tempPrice)%>
<%
tAprice=(tempPrice*ccur(pcCartArray(f,2)))
response.write scCurSign&money(tAprice)
%>
<% end if %>
<% Next
'#####################
' END LOOP
'#####################
'// If there are product options AND NOt GGG, show link to edit them
if trim(pcCartArray(f,16))="" AND Session("Cust_BuyGift")="" then %>
<%=dictLanguage.Item(Session("language")&"_showcart_21")%>
<% end if %>
<%
End if
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' END: SHOW PRODUCT OPTIONS
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pRowPrice=pRowPrice + ccur(pcCartArray(f,2) * pcCartArray(f,5)) %>
<% '// END 4th Row - Product Options %>
<% '// START 5th Row - Custom Input Fields %>
<% 'if there are custom input fields, show them here
if trim(pcCartArray(f,21))<>"" then %>
<% response.write replace(pcCartArray(f,21),"''","'") %>
<% End if %>
<% 'if there are custom input fields and NO product options, and not GGG, and NOT BTO, show EDIT here
if len(pcv_strOptionsArray)=0 AND trim(pcCartArray(f,16))="" AND Session("Cust_BuyGift")="" then
query= "SELECT xfield1,xfield2,xfield3 FROM products WHERE idproduct="&pcCartArray(f,0)
set rs=server.createobject("adodb.recordset")
set rs=conntemp.execute(query)
if err.number<>0 then
call LogErrorToDatabase()
set rs=nothing
call closedb()
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
if not rs.eof then
if rs("xfield1") <> 0 or rs("xfield2") <> 0 OR rs("xfield3") <> 0 then %>
<% End if %>
<% End if
set rs=nothing %>
<% End if %>
<% '// END 5th Row - Custom Input Fields %>
<% 'if items quantities discounts apply to this product, show the total applied amount here
if 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)
if err.number<>0 then
call LogErrorToDatabase()
set rs=nothing
call closedb()
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
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 %>
<% '// START 6th Row - Discounts %>
<%=dictLanguage.Item(Session("language")&"_showcart_23")%>
- <% response.write scCurSign & money(ItemsDiscounts) %>
<% else
pcCartArray(f,30)=0
end if
End if%>
<% '// END 6th Row - Discounts %>
<% 'BTO Additional Charges
if 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
call LogErrorToDatabase()
set rs=nothing
call closedb()
response.redirect "techErr.asp?err="&pcStrCustRefID
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%>
<% '// START 7th Row - BTO Additional Charges %>
<% pRowPrice=pRowPrice+ccur(pcCartArray(f,31)) %>
<%=bto_dictLanguage.Item(Session("language")&"_viewcart_3")%>
<% for i=lbound(ArrCProduct) to (UBound(ArrCProduct)-1)
if pcv_SpecialServer=1 then
ArrCValue(i)=replace(ArrCValue(i),".",",")
end if
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)
if err.number<>0 then
call LogErrorToDatabase()
set rs=nothing
call closedb()
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
strCategoryDesc=rs("categoryDesc")
strDescription=rs("description")
set rs=nothing %>
<%=strCategoryDesc%>: <%=strDescription%>
<%if (ccur(ArrCValue(i))>0) then%>
<%=scCurSign & money(ArrCValue(i))%>
<%end if%>
<% next %>
<%if pcv_FinalizedQuote=0 then%> " alt="Reconfigure <%=pcCartArray(f,1)%>"> <%end if%>
<% end if %>
<% End if
'BTO Additional Charges
'// END 7th Row - BTO Additional Charges
'// START 8th Row - Quantity Discounts
'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-ccur(pcCartArray(f,15))
%>
<%'APP-S
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
pcv_tmpPPrd1=pcv_tmpPPrd(ubound(pcv_tmpPPrd))
query="SELECT discountPerUnit FROM discountsPerQuantity WHERE idProduct=" & pcv_tmpPPrd1
set rsT=connTemp.execute(query)
if not rsT.eof then%>
<%else%>
<%end if
set rsT=nothing
else%>
<%end if
'APP-E%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_20")%> <%response.write dictLanguage.Item(Session("language")&"_showcart_20b")%>
-
<% response.write scCurSign & money(pcCartArray(f,15)) %>
<% End if %>
<% '// END 8th Row - Quantity Discounts
'// START 9th Row - Product Subtotal %>
<% if pExtRowPrice<>pRowPrice then %>
<%response.write dictLanguage.Item(Session("language")&"_showcart_22")%>
<% response.write scCurSign & money(pRowPrice) %>
<% end if %>
<% '// END 9th Row - Product Subtotal
'// START 10th Row - Cross Sell Bundle Discount %>
<% if (pcCartArray(f,27)>"0") AND (pcCartArray(f,28)>"0") then %>
<%response.write dictLanguage.Item(Session("language")&"_showcart_26")%>
<% response.write scCurSign & money( ((ccur(pcCartArray(f,28)) + ccur(pcCartArray(cint(pcCartArray(f,27)),28))) * -1) * pcCartArray(f,2)) %>
<% end if %>
<%'// END 10th Row - Cross Sell Bundle Discount
'// START 11th Row - Cross Sell Bundle Subtotal %>
<% if (pcCartArray(f,27)>"0") AND (pcCartArray(f,28)>"0") then
pRowPrice = ( ccur(pRowPrice) + ccur(ProList(cint(pcCartArray(f,27)),2)) ) - ( ( ccur(pcCartArray(f,28)) + ccur(pcCartArray(cint(pcCartArray(f,27)),28) ) ) * pcCartArray(f,2) )%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_22")%>
<% response.write scCurSign & money(pRowPrice) %>
<% end if %>
<% '// END 11th Row - Cross Sell Bundle Subtotal %>
<%
ProList(f,2)=pRowPrice
'// Don't Add to total if parent of a Bundle Cross Sell Product
pcv_HaveBundles=0
if pcCartArray(f,27)=-1 then
for mc=1 to pcCartIndex
if (pcCartArray(mc,27)<>"") AND (pcCartArray(mc,12)<>"") then
if cint(pcCartArray(mc,27))=f AND cint(pcCartArray(mc,12))="0" then
pcv_HaveBundles=1
exit for
end if
end if
next
end if
if (pcCartArray(f,27)>-1) OR (pcv_HaveBundles=0) then
total=total + pRowPrice
end if
if Cint(pcCartArray(f,9))>totalDeliveringTime then
totalDeliveringTime=Cint(pcCartArray(f,9))
end if
end if ' item deleted
next
' ------------------------------------------------------
' START - Calculate category-based quantity discounts
' ------------------------------------------------------
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)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rs=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
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
'APP-S
if (pcCartArray(f,32)<>"") then
pcv_tmpPPrd=split(pcCartArray(f,32),"$$")
pcv_tmpID=pcv_tmpPPrd(ubound(pcv_tmpPPrd))
else
pcv_tmpID=ProList(f,0)
end if
'APP-E
'APP-S
query="select idproduct from categories_products where idcategory=" & rs("IDCat") & " and idproduct=" & pcv_tmpID
'APP-E
set rstemp=server.CreateObject("ADODB.RecordSet")
set rstemp=connTemp.execute(query)
if err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rstemp=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
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 err.number<>0 then
'//Logs error to the database
call LogErrorToDatabase()
'//clear any objects
set rstemp=nothing
'//close any connections
call closedb()
'//redirect to error page
response.redirect "techErr.asp?err="&pcStrCustRefID
end if
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
'// Round the Category Discount to two decimals
if CatDiscTotal<>"" and isNumeric(CatDiscTotal) then
CatDiscTotal = Round(CatDiscTotal,2)
end if
' ------------------------------------------------------
' END - Calculate category-based quantity discounts
' ------------------------------------------------------
' Calculate & display order total
total=total-CatDiscTotal %>
" onclick="javascript: if ((RemainIssue!='') || (RemainIssue1!='')) {alert('<% Response.write(dictLanguage.Item(Session("language")&"_alert_8b"))%>'); return(false);} else {<%if Session("Cust_GW")="1" then%>document.recalculate.actGW.value='';<%else%><%if HaveGcsTest=1 then%>document.recalculate.actGCs.value='';<%end if%><%end if%> return(true);}">
<%
'// GGG Add-on start
if pcv_strShowCheckoutBtn=1 then %>
<% If Session("Cust_GW")="1" Then %>
" border="0" onclick="javascript: if ((RemainIssue!='') || (RemainIssue1!='')) {alert('<% Response.write(dictLanguage.Item(Session("language")&"_alert_8b"))%>'); return(false);} else {document.recalculate.actGW.value='Hello'; return(true);}">
<% Else %>
<% if HaveGcsTest=1 then %>
" border="0" onclick="javascript: if ((RemainIssue!='') || (RemainIssue1!='')) {alert('<% Response.write(dictLanguage.Item(Session("language")&"_alert_8b"))%>'); return(false);} else {document.recalculate.actGCs.value='Hello'; return(true);}">
<% else %>
<% end if %>
<% End If %>
<%
'// GGG Add-on end
end if
%>
<%'GGG Add-on start
gHaveGR=0
query="select pcEv_IDEvent from pcEvents where pcEv_IDCustomer=" & Session("idCustomer") & " and pcEv_Active=1"
set rs1=conntemp.execute(query)
if not rs1.eof then
gHaveGR=1
end if
if (not (Session("idCustomer")=0)) and (gHaveGR=1) and (session("Cust_buyGift")="") then%>
<%end if
'GGG Add-on end%>
<%response.write dictLanguage.Item(Session("language")&"_showcart_12")%> <% response.write scCurSign & money(total) %>
<%' Display category-based quantity discounts
if CatDiscTotal>0 then%>
<%response.write dictLanguage.Item(Session("language")&"_catdisc_1")%> <% response.write scCurSign & money(CatDiscTotal) %>
<% end if %>
<%
' ------------------------------------------------------
' Show horizontal line if there is more content
' ------------------------------------------------------
if scShowCartWeight="-1" or (iShipService=0 and scShowEstimateLink="-1") then
%>