%@LANGUAGE="VBSCRIPT"%> <% 'Option Explicit %> <% '================================================================ 'Application Info: ' Cartweaver© 2002 - 2005, All Rights Reserved. 'Developer Info: ' Application Dynamics Inc. ' 1560 NE 10th ' East Wenatchee, WA 98802 'Support Info: http://www.cartweaver.com/go/asphelp ' 'Cartweaver Version: 3.0.0 - Date: 21 April 2007 '================================================================ 'Name: Application.asp 'DESCRIPTION: The Application.asp file is the root file for the ' entire Cartweaver application. This file defines the store-wide ' variables that will control your cart, and also includes all of ' the necessary function files to make the cart function. You can ' edit all of the settings on this page manually or through the ' Cartweaver 3 Setup Server Behavior. Variables are listed in the ' order in which the Cartweaver 3 Setup Server Behavior adds them ' to the page. '================================================================ '*Do Not Remove This Line* Prevents extraneous %@LANGUAGE="VBSCRIPT"% declaration. '=== Start Cartweaver Variables === Const datasource = "DSN=swankyrooms;User ID=;Password=;" Const dbType = "Access" Dim websiteURL : websiteURL = "http://www.swankyrooms.co.uk/" Dim websiteSSLURL : websiteSSLURL = "" Dim onSubmitAction : onSubmitAction = "Confirm" Dim targetResults : targetResults = "Results.asp" Dim targetDetails : targetDetails = "Details.asp" Dim targetGoToCart : targetGoToCart = "ShowCart.asp" Dim targetCheckout : targetCheckout = "OrderForm.asp" Dim targetConfirmOrder : targetConfirmOrder = "Confirmation.asp" Const cwLocale = "2057" Const uploadCom = "persits upload" Const mailObj = "CDOSYS" Const mailServer = "mail.swankyrooms.co.uk" Dim paymentAuthType : paymentAuthType = "processor" Dim paymentAuthName : paymentAuthName = "CWIncPayPal.asp" Const debugPassword = "westbrom1" '=== End Cartweaver Variables === 'Include all Cartweaver application functions %> <% 'Start Cartweaver Cart Set cwCart = New cwObjCartweaver %> <% %>
| <%= cwCartLinks(cwCart.Count, Null) %> <% '================================================================ 'Application Info: Cartweaver© 2002 - 2007, All Rights Reserved. 'Developer Info: Application Dynamics Inc. ' 1560 NE 10th ' East Wenatchee, WA 98802 'Support Info: http://www.cartweaver.com/go/asphelp ' 'Cartweaver Version: 3.0.0 - Date: 21 April 2007 '================================================================ 'Name: CWIncShowCart.asp 'Description: ' This page shows the user their shopping cart contents. If the ' user is checking it out, it also collects their credit card ' information and submits the data to your payment gateway or ' payment processor. If the order is processed successfully the ' customer is sent to the confirmation page. '================================================================ '*Do Not Remove This Line* Prevents extraneous %@LANGUAGE="VBSCRIPT"% declaration from being added by Dreamweaver. %> <% 'START [ SET PARAMITERS ] If Session("ShipToCountryID") = "" Then Session("ShipToCountryID") = "1" If Session("CheckingOut") = "" Then Session("CheckingOut") = False bolHasCart = False If Request.Form("promocode") <> "" Then Session("PromotionalCode") = Request.Form("promoCode") Session("AvailableDiscounts") = "" Call cwGetDiscounts() End If Dim shippingDiscounts : shippingDiscounts = cwGetshippingDiscounts() Dim displayLineItemTaxes : displayLineItemTaxes = CBool(Application("displayLineItemTaxes")) Dim displayLineItemDiscount : displayLineItemDiscount = False If CBool(Application("EnableDiscounts")) Then displayLineItemDiscount = CBool(Application("displayLineItemDiscount")) Dim CartColumnCount : CartColumnCount = 0 If DisplayLineItemTaxes Then CartColumnCount = CartColumnCount + 2 If DisplayLineItemDiscount Then CartColumnCount = CartColumnCount + 1 'Set defaults for Credit Card processing fields cstCCardHolderName = Request.Form("cstCCardHolderName") cstCCardType = Request.Form("cstCCardType") cstCCNumber = Request.Form("cstCCNumber") cstCCV = Request.Form("cstCCV") cstExprMonth = cwParam(Request.Form("cstExprMonth"),0) cstExprYr = cwParam(Request.Form("cstExprYr"),0) If cstExprMonth = "forgot" Then cstExprMonth = 0 If cstExprYr = "forgot" Then cstExprYr = 0 'START [ CART ACTIONS ] 'UPDATE CART ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If Request.Form("action") <> "" Then 'Loop through the form For i = 0 to Request.Form("rowCount") If IsNumeric(Request.Form("qty" & i)) Then If Request.Form("qty" & i) = 0 OR cwListFind(Request.Form("remove"), Request.Form("lineID" & i)) <> -1 Then 'If the user has set the quantity to 0 or checked the delete box, then remove the 'item from the cart. cwCart.Delete Request.Form("lineID" & i) Else 'The user has updated the count. cwCart.Update Request.Form("lineID" & i), Request.Form("qty" & i) End If 'Request.Form("qty" & i) = 0 OR Request.Form("delete" & i) <> "" End If Next 'i = 0 to Request.Form("rowCount") If cwCart.CartError = "" AND Request.Form("selectShipping") = "" AND NOT cwCart.StockAlert Then Response.Redirect(ThisPageQS) End If 'Request.Form("action") <> "" 'END [ CART ACTIONS ] ===================================================== Dim Cart Set Cart = cwGetCart(Request.Cookies("CartID"), Request.Cookies("TaxStateID"), Request.Cookies("TaxCountryID")) cwDebugger cwDumpDictionary(Cart) If Cart("Products").Count = 0 Then bolHasCart = False Else bolHasCart = True If Session("CheckingOut") Then 'Get customer shipping and billing information Set rsCWGetCustData = cwOpenQuery("SELECT * FROM cwq_CustData WHERE cst_ID = '" & Session("CustomerID") & "';",datasource) Set rsCWGetBillTo = rsCWGetCustData.Clone rsCWGetBillTo.Filter = "CustSt_Destination = 'BillTo'" Set rsCWGetShipTo = rsCWGetCustData.Clone rsCWGetShipTo.Filter = "CustSt_Destination = 'ShipTo'" cwDebugger cwQueryDump(rsCWGetCustData,"rsCWGetCustData") cwDebugger cwQueryDump(rsCWGetBillTo,"rsCWGetBillTo") cwDebugger cwQueryDump(rsCWGetShipTo,"rsCWGetShipTo") 'For Shipping, set ship to StProv Shipping extension shipExtension = rsCWGetShipTo("stprv_Ship_Ext") cwDebugger "shipExtension: " & shipExtension '============================================================= 'Calculate SHIPPING [ START ]================================ '============================================================= 'Get Shipping Methods Available for Customer's Location 'If you're not charging shipping by weight, then just get everything If Request.Form("PickShipPref") = "" Then If Session("PickShipPref") = "" Then Session("PickShipPref") = 0 Else Session("PickShipPref") = Request.Form("PickShipPref") End If 'If shipping is enabled, perform shipping calculations. If Application("EnableShipping") Then cwDebugger "Session(""PickShipPref""): " & Session("PickShipPref") & " - " & Request.Form("PickShipPref") 'Get shipping list and perform shipping calculations Set rsCWShipList = cwShipping("shiplist",ShipCalcType,rsCWGetShipTo("country_ID"),Cart("CartTotals")("Weight"),Cart("CartTotals")("Sub"),shipExtension,ShipTotal,Session("PickShipPref")) cwDebugger cwQueryDump(rsCWShipList,"rsCWShipList") cwDebugger "Session(""PickShipPref"") after running cwShipping: " & Session("PickShipPref") cwDebugger "ShipTotal: " & ShipTotal Else Session("PickShipPref") = 0 ShipTotal = 0 End If '============================================================= 'Calculate ORDER TOTAL [ START ]============================= '============================================================= Cart("CartTotals")("Shipping") = ShipTotal Cart("CartTotals")("Total") = Cart("CartTotals")("ProductTotal") + Cart("CartTotals")("Shipping") If shippingDiscounts <> "" Then 'There is a shipping discount Cart("CartTotals")("Shipping") = cwGetShippingDiscount(Cart("CartTotals")("Shipping"), shippingDiscounts, Session("PickShipPref"), Cart("CartTotals")("ProductTotal")) Cart("CartTotals")("ShippingDiscounts") = ShipTotal - Cart("CartTotals")("Shipping") End If Cart("CartTotals")("ShippingTax") = cwGetShippingTaxes(rsCWGetShipTo("country_ID"), ShipTotal, Cart) Cart("CartTotals")("Total") = Cart("CartTotals")("ProductTotal") + Cart("CartTotals")("Shipping") + Cart("CartTotals")("ShippingTax") End If 'Session("CheckingOut") End If 'NOT rsCWGetCart.EOF 'If the "PLACE ORDER" button has been clicked... 'START [ PROCESS ORDER ] =================================================== %> <% If Request.Form("placeOrder") <> "" Then 'Process order FieldErrorText = cwProcessOrder(Cart,Session("CustomerID"),Session("PickShipPref")) End If 'Request.Form("placeOrder") <> "" 'END [ PROCESS ORDER ] =============================++====================== %> <% If ((QtyAdded) <> (0)) AND ((FieldError) = ("")) Then 'Start CCR %> Your shopping cart has been successfully updated. <% End If 'End CCR: ((QtyAdded) <> (0)) AND ((FieldError) <> ("")) %> <% If (cwCart.StockAlert) = (True) Then 'Start CCR %>You have selected more quantity than is currently available. <% End If 'End CCR: (cwCart.StockAlert) = (True) %> <% If (bolHasCart) = (False) Then 'Start CCR %>There is nothing in your Cart at this time. <% Else 'CCR %> <% If (Session("CheckingOut")) = (True) Then 'Start CCR %> <% If (FieldErrorText) <> ("") Then 'Start CCR %>There was a problem while processing your credit card. Your Credit Card Transaction Has Failed.
If address is incorrect - Return to Order Form <% End If 'End CCR: (Session("CheckingOut")) = (True) %> <% If CBool(Application("enableDiscounts")) Then %> <% End If 'CBool(Application("enableDiscounts")) %> <% If (Session("CheckingOut")) = (False) Then 'Start CCR %> <% If (Request.QueryString("returnurl")) <> ("") Then 'Start CCR %> <% End If 'End CCR: (Request.QueryString("returnurl")) <> ("") %> <% Else 'CCR, if Checking out, show credit card input form or Processor information %> <% End If 'End CCR: (Session("CheckingOut")) = (False) %> <% End If 'End CCR: (bolHasCart) = (False) %> <% cwCloseRecordset(rsCWGetCart) cwCloseRecordset(rsCWGetCustData) cwCloseRecordset(rsCWGetBillTo) cwCloseRecordset(rsCWGetShipTo) %> <%= cwDebugOutput %> |
|||||||||||||||||
Copyright © 2007 Swanky Rooms. All rights reserved. Website Designed by TECHroute |