<% ' Comersus 4.2x Sophisticated Cart ' Developed by Rodrigo S. Alhadeff ' Dic-2002 ' Open Source License can be found at License.txt ' http://www.comersus.com ' Details: show cart contents %> <% on error resume next dim mySQL, connTemp, rsTemp, rsTemp2, rsTemp7 ' get settings pDefaultLanguage = getSettingKey("pDefaultLanguage") pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode") pCurrencySign = getSettingKey("pCurrencySign") pDecimalSign = getSettingKey("pDecimalSign") pCompany = getSettingKey("pCompany") pCompanyLogo = getSettingKey("pCompanyLogo") pAuctions = getSettingKey("pAuctions") pListBestSellers = getSettingKey("pListBestSellers") pNewsLetter = getSettingKey("pNewsLetter") pPriceList = getSettingKey("pPriceList") pStoreNews = getSettingKey("pStoreNews") pOneStepCheckout = getSettingKey("pOneStepCheckout") total = Cint(0) totalDeliveringTime = Cint(0) pIdDbSession = checkSessionData() pIdDbSessionCart = checkDbSessionCartOpen() pIdCustomerType = getSessionVariable("idCustomerType",1) ' check if the cart is empty if countCartRows(pIdDbSessionCart)=0 then response.redirect "message.asp?message="&Server.Urlencode(dictLanguage.Item(Session("language")&"_showcart_1") ) end if %>


<%=dictLanguage.Item(Session("language")&"_showcart_3")%>

<% ' get all products in the cart mySQL="SELECT idCartRow, cartRows.idProduct, quantity, unitPrice, unitBtoBPrice, description, sku, deliveringTime, personalizationDesc FROM cartRows, products WHERE cartRows.idProduct=products.idProduct AND cartRows.idDbSessionCart="&pIdDbSessionCart call getFromDatabase(mySQL, rstemp, "showCart") do while not rstemp.eof pIdCartRow = rstemp("idCartRow") pIdProduct = rstemp("idProduct") pQuantity = rstemp("quantity") pUnitPrice = Cdbl(rstemp("unitPrice")) pUnitBtoBPrice = Cdbl(rstemp("unitBtoBPrice")) pDescription = rstemp("description") pSku = rstemp("sku") pDeliveringTime = rstemp("deliveringTime") pPersonalizationDesc = rstemp("personalizationDesc") ' check if the product has a free product or is a free product mySQL="SELECT idProductFree FROM getFreeProduct WHERE idProduct="&pIdProduct call getFromDatabase (mySql, rsTemp7, "showCart") if not rstemp7.eof then pItHasFreeProduct=-1 else pItHasFreeProduct=0 end if switchProductsLanguage session("language"), pIdProduct, pDetails, pDescription %> <% ' for Retail or WholeSale without btob price assigned shows Retail Price if pIdCustomerType=1 or (pIdCustomerType=2 and pUnitBtoBPrice=0) then pRowPrice = Cdbl(pQuantity * (pOptionGroupsTotal+pUnitPrice) ) else pRowPrice = Cdbl(pQuantity * (pOptionGroupsTotal+pUnitBtoBPrice) ) end if%>

<% total = total + pRowPrice if Cint(pDeliveringTime)>totalDeliveringTime then totalDeliveringTime = Cint(pDeliveringTime) end if rstemp.moveNext loop%>

<%=dictLanguage.Item(Session("language")&"_showcart_4")%> <%=dictLanguage.Item(Session("language")&"_showcart_5")%> <%=dictLanguage.Item(Session("language")&"_showcart_6")%> <%=dictLanguage.Item(Session("language")&"_showcart_7")%> <%=dictLanguage.Item(Session("language")&"_showcart_8")%> <%=dictLanguage.Item(Session("language")&"_showcart_9")%>
<%if pItHasFreeProduct=0 and pUnitPrice+pUnitBtoBPrice>0 then%> <%else%> <%=pQuantity%> <%end if%> <% if pSku="" then ' use idProduct response.write pIdProduct else ' use sku response.write pSku end if%> <%=pDescription%> <%if pPersonalizationDesc<>"" then response.write " (" &pPersonalizationDesc& ")"%> <% pOptionGroupsTotal=0 ' get optionals for current cart row mySQL="SELECT options.idOption as myIdOption, optionDescrip, priceToAdd FROM options, cartRowsOptions WHERE options.idOption=cartRowsOptions.idOption AND idCartRow="&pIdCartRow call getFromDatabase(mySQL, rstemp2, "showCart") do while not rstemp2.eof pIdOption = rstemp2("myIdOption") pOptionDescrip = rstemp2("optionDescrip") pPriceToAdd = rstemp2("priceToAdd") switchOptionsLanguage session("language"), pIdOption, pOptionDescrip response.write pOptionDescrip if pPriceToAdd>0 then response.write " "&pCurrencySign & money(pPriceToAdd) end if response.write "
" pOptionGroupsTotal = pOptionGroupsTotal+ pPriceToAdd rstemp2.movenext loop %>
<%=pCurrencySign & money(pRowPrice) %> <%= dictLanguage.Item(Session("language")&"_showcart_10")%>

">

<%=dictLanguage.Item(Session("language")&"_showcart_12")%> <%=pCurrencySign & money(total) %> <%=dictLanguage.Item(Session("language")&"_showcart_13")%>
<%=dictLanguage.Item(Session("language")&"_showcart_16")%><% if totalDeliveringTime>0 and totalDeliveringTime<999 then response.write totalDeliveringTime & dictLanguage.Item(Session("language")&"_showcart_17") end if if totalDeliveringTime=0 then response.write dictLanguage.Item(Session("language")&"_showcart_18") end if ' use 999 for undetermined if totalDeliveringTime>998 then response.write dictLanguage.Item(Session("language")&"_showcart_19") end if %>

<%=dictLanguage.Item(Session("language")&"_showcart_15")%>
<%=dictLanguage.Item(Session("language")&"_showcart_14")%>

<%call closeDb()%>