<% ' Comersus Shopping Cart ' Comersus Open Technologies ' United States ' Software License can be found at License.txt ' http://www.comersus.com %> <% ' on error resume next dim mySQL, connTemp, rsTemp, rsTemp2, rsTemp3 ' get settings pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode") pCurrencySign = getSettingKey("pCurrencySign") pDecimalSign = getSettingKey("pDecimalSign") pMoneyDontRound = getSettingKey("pMoneyDontRound") pCompany = getSettingKey("pCompany") pCompanySlogan = getSettingKey("pCompanySlogan") pCompanyAddress = getSettingKey("pCompanyAddress") pCompanyZip = getSettingKey("pCompanyZip") pCompanyCity = getSettingKey("pCompanyCity") pCompanyStateCode = getSettingKey("pCompanyStateCode") pCompanyCountryCode = getSettingKey("pCompanyCountryCode") pCompanyPhone = getSettingKey("pCompanyPhone") pCompanyFax = getSettingKey("pCompanyFax") pChangeDecimalPoint = getSettingKey("pChangeDecimalPoint") pEncryptionMethod = getSettingKey("pEncryptionMethod") pOrderFieldName1 = getSettingKey("orderFieldName1") pOrderFieldName2 = getSettingKey("orderFieldName2") pOrderFieldName3 = getSettingKey("orderFieldName3") pDateSwitch = getSettingKey("pDateSwitch") pByPassShipping = getSettingKey("pByPassShipping") pBonusPointsPerPrice = getSettingKey("pBonusPointsPerPrice") pHeaderKeywords = getSettingKey("pHeaderKeywords") pAuctions = getSettingKey("pAuctions") pListBestSellers = getSettingKey("pListBestSellers") pNewsLetter = getSettingKey("pNewsLetter") pPriceList = getSettingKey("pPriceList") pStoreNews = getSettingKey("pStoreNews") pUseVatNumber = getSettingKey("pUseVatNumber") pShowNews = getSettingKey("pShowNews") pUseShippingAddress = getSettingKey("pUseShippingAddress") pStoreClosed = getSettingKey("pStoreClosed") pRealTimeShipping = getSettingKey("pRealTimeShipping") pIdDbSession = checkSessionData() pIdDbSessionCart = checkDbSessionCartOpen() pIdCustomer = getSessionVariable("idCustomer",0) pIdCustomerType = getSessionVariable("idCustomerType",1) pDiscountCode = getSessionVariable("discountCode","") pTime = getUserInput(request.querystring("time"),12) ' if the store is closed it will not allow checkout if pStoreClosed="-1" then response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(391,"Sorry, your cannot checkout, the store is closed right now.")) end if if countCartRows(pIdDbSessionCart)=0 then response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(392,"The cart is empty, you cannot checkout.")) end if if pIdCustomer=0 then response.redirect "comersus_checkoutCustomerForm.asp" end if ' get customer information mySQL="SELECT * FROM customers WHERE idCustomer=" &pIdCustomer call getFromDatabase(mySQL, rstemp, "checkout2") if not rstemp.eof then pName = rstemp("name") pLastName = rstemp("lastName") pCustomerCompany = rstemp("customerCompany") pEmail = rstemp("email") pPassword = rstemp("password") pPhone = rstemp("phone") pShippingName = rstemp("shippingName") pShippingLastName = rstemp("shippingLastName") pAddress = rstemp("address") pZip = rstemp("zip") pStateCode = rstemp("stateCode") pState = rstemp("state") pCity = rstemp("city") pCountryCode = rstemp("countryCode") pShippingAddress = rstemp("shippingAddress") pShippingZip = rstemp("shippingZip") pShippingStateCode = rstemp("shippingStateCode") pShippingState = rstemp("shippingState") pShippingCity = rstemp("shippingCity") pShippingCountryCode = rstemp("shippingCountryCode") end if if pShippingCountryCode<>"" then pFilterCountryCode=pShippingCountryCode else pFilterCountryCode=pCountryCode end if ' calculate total price of the order, total weight and product total quantities pSubTotal = Cdbl(calculateCartTotal(pIdDbSessionCart)) pCartTotalWeight = Cdbl(calculateCartWeight(pIdDbSessionCart)) pCartQuantity = Cdbl(calculateCartQuantity(pIdDbSessionCart)) ' populate payment methods pStringPaymentMethods = createArrayPayments(pCartQuantity, pCartTotalWeight, pSubTotal) if pStringPaymentMethods="" then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("There are no payments available. Please contact us") end if pArrayPaymentMethods = split(pStringPaymentMethods,"|") ' populate shipment methods ' calculate Free Shipping Items inside the cart pCartFreeShippingTotal = Cdbl(calculateFreeShippingTotal(pIdDbSessionCart)) pCartFreeShippingWeight = Cdbl(calculateCartFreeShippingWeight(pIdDbSessionCart)) pCartFreeShippingQuantity = Cdbl(calculateCartFreeShippingQuantity(pIdDbSessionCart)) Select Case lcase(pRealTimeShipping) Case "ups" pStringShipmentMethods = createArrayShipmentsUps(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) Case "usps" if pFilterCountryCode="US" then pStringShipmentMethods = createArrayShipmentsUsps(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) else pStringShipmentMethods = createArrayShipmentsUspsInt(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) end if Case "intershipper" pStringShipmentMethods = createArrayShipmentsIntershipper(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) Case "fedex" pStringShipmentMethods = createArrayShipmentsFedex(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) Case "ca" pStringShipmentMethods = createArrayShipmentsCA(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) Case Else pStringShipmentMethods = createArrayShipments(pCartQuantity-pCartFreeShippingQuantity, pCartTotalWeight-pCartFreeShippingWeight, pSubTotal-pCartFreeShippingTotal) End Select if pStringShipmentMethods="" then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("There are no shipments available. Please contact us") end if pArrayShipmentMethods = split(pStringShipmentMethods,"|") ' retrieve discount pDiscountDesc ="" pDiscountAmount =0 call getDiscount(pDiscountCode, pDiscountDesc, pDiscountAmount) pSubTotal=pSubTotal-pDiscountAmount %>
<% ' iterate through cart mySQL="SELECT idCartRow, cartRows.idProduct, quantity, unitPrice, description, sku, deliveringTime, personalizationDesc FROM cartRows, products WHERE cartRows.idProduct=products.idProduct AND cartRows.idDbSessionCart="&pIdDbSessionCart call getFromDatabase(mySQL, rstemp, "checkout2") do while not rstemp.eof pIdCartRow = rstemp("idCartRow") pIdProduct = rstemp("idProduct") pQuantity = rstemp("quantity") pUnitPrice = Cdbl(rstemp("unitPrice")) pDescription = rstemp("description") pSku = rstemp("sku") pPersonalizationDesc = rstemp("personalizationDesc") %> <%rstemp.movenext loop%> <%if Cdbl(pBonusPointsPerPrice)>0 then%> <% pBonusPoints=getBonusPoints(pIdCustomer) if pBonusPoints>=pSubTotal-pDiscountAmount then pBonusPoints=pSubTotal-pDiscountAmount else pBonusPoints=0 end if pSubTotal=pSubTotal-pBonusPoints %> <%end if%> <%if pByPassShipping="0" then%> <%end if%> <%if pUseVatNumber="-1" then%> <%end if%> <%if pOrderFieldName1<>"" then%> <%end if%> <%if pOrderFieldName2<>"" then%> <%end if%> <%if pOrderFieldName3<>"" then%> <%end if%>
 
<%=getMsg(58,"checkout")%> <%if pTime<>"" then%>

<%=getMsg(681,"Reloaded")%> <%end if%>

<%=getMsg(411,"billing")%>

<%=getMsg(448,"name")%>: <%=pName&" "&pLastName%> <%if pCustomerCompany<>"" then%>
<%=getMsg(449,"cpany")%>: <%=pCustomerCompany%> <%end if%>
<%=getMsg(450,"phone")%>: <%=pPhone%>
<%=getMsg(451,"addr")%>: <%=pAddress%> <%=pCity%>, <%=pState & pStateCode%> <%=pZip%>,  <%=getCountryName(pCountryCode)%>

[<%=getMsg(185,"modify")%>] <%if pUseShippingAddress="-1" and pByPassShipping="0" then%>

<%=getMsg(420,"shipping")%>
<%if trim(pShippingAddress)="" or isNull(pShippingAddress) then%>
<%=getMsg(471,"ship address")%>: <%=getMsg(472,"same as bill")%> <%else%>
<%=getMsg(448,"name")%>: <%=pShippingName&" "&pShippingLastName%>
<%=getMsg(471,"ship address")%>: <%=pShippingAddress%> <%=pShippingCity%>, <%=pShippingState & pShippingStateCode%>  <%=pShippingZip%>  <%=pShippingCountryCode%> <%end if%>

[<%=getMsg(185,"modify")%>] <%end if%>

<%=getMsg(453,"qty")%> <%=getMsg(454,"item")%> <%=getMsg(455,"variat")%> <%=getMsg(456,"price")%>
<%=pQuantity%> <%=pSku & " "&pDescription%> <%if pPersonalizationDesc<>"" then response.write " (" &pPersonalizationDesc& ")"%> <%=getCartRowOptionals(pIdCartRow)%> <%=pCurrencySign & money(getCartRowPrice(pIdCartRow)) %>

[<%=getMsg(185,"modify")%>]

  <%=getMsg(459,"discount")%> - <%=pCurrencySign & money(pDiscountAmount)%>
  <%=getMsg(464,"points")%> - <%=pCurrencySign & money(pBonusPoints)%>
  <%=getMsg(465,"subtotal")%> <%=pCurrencySign & money(pSubTotal)%>
 

<%=getMsg(457,"payment")%> <%=pPaymentDesc%>
<%=getMsg(458,"ship method")%> <%=pShipmentDesc%>

<%=getMsg(733,"VAT")%>
<%=pOrderFieldName1%>
<%=pOrderFieldName2%>
<%=pOrderFieldName3%>

<%=getMsg(444,"comments")%>
 
">


<%call closeDb()%>