<%@language=VBScript%> <%option explicit%> <% Response.Redirect "/onlinestore/" Response.End '*********************************************************************************************** 'Created: May 15, 2000 'Modified: Nov 7, 2001 'Created by: Reid Guest 'Modified by: Jody Lanteigne 'Purpose: Shopping Cart Module '*********************************************************************************************** 'VB Script programming here (unless it must reside within the body) Function GetProvStateCountryName(intProvStateID, strType) Dim strSQL2 If strType = "p" Then ' Get Province name strSQL2 = "SELECT " & strLanguage & "Province FROM Provinces WHERE (ProvinceID=" & Cstr(intProvStateID) & ")" Elseif strType = "s" Then strSQL2 = "SELECT StateName FROM States WHERE (StateID=" & Cstr(intProvStateID) & ")" Elseif strType = "c" Then strSQL2 = "SELECT Country FROM Countries WHERE (CountryID=" & Cstr(intProvStateID) & ")" End if set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL2, myConnection, adOpenKeySet GetProvStateCountryName = objRecordSet(0) objRecordSet.Close End Function 'Declare all variables used in this page Dim intNumberOfItemsInCart, intOldNumberOfItemsInCart, arrShoppingCart, intRecordsPerPage Dim strItemValue, intItemID, intItemQuantity, intPositionOfPipe, intPositionOfPipe2, strItemPrice, intItemsNotAdded Dim intTotalNumOfItems Dim dblPriceTotal, dblPriceSubTotal ' '2's on the end differentiate from 'CreatePageBottom' variables 'Moment-specific variables (used here and in the publictemplate for the sidebar moments) Dim intCounter, strDisplayDate, strDisplayTitle, strDisplayLink, intMomentID, intMomentCount, intPartnerID, intPartnerCount Dim strSearchID, strSearchText, strSearchFields, strSearchCategories, strSearchCategoryList, intLowPrice, intHighPrice, strUnorderedSQL, strRetrieveItems Dim objSearchResults, intRowCounter, strOrderByClause Dim strAlternatingColor, intCurrentPage, intTotalPages, strItemID, strItemNumber, strCategory, strName, strPrice Dim strSortByCategory, strSortByName, strSortByPrice Dim intCorporateMembersMemberID, intIndividualMembersMemberID, intCorporateMemberID, intChildMemberID 'Declare the record set object to be used for all record retrievals requested by this application Dim strSQL Dim onLine ' used for testing locally onLine = false Dim strFormAction, strRelativePath strFormAction = request.form("formAction") If strFormAction = "" Then strFormAction = Request.QueryString("FormAction") End If If strFormAction = "" Then strFormAction = "onLoad" End If strRelativePath="../" intCorporateMemberID = Session("public_CorporateMemberID") intCorporateMembersMemberID = Session("public_MemberID") intIndividualMembersMemberID = Session("public_IndividualMemberID") 'response.write strFormAction Select Case strFormAction '================================================================================================== ' Provide GUI for catalogue searching '================================================================================================== Case "onLoad", "ShowSearchForm": Dim strPageContent Call ConnectToDatabase() strSQL="SELECT "& strLanguage &"Page AS PageContent FROM SC_Introduction WHERE (IntroID=1) AND (Len("& strLanguage &"Page)>0)" Set objRecordSet = Server.CreateObject("ADODB.RecordSet") Set objRecordSet = GetRSFromDatabase(strSQL) If Not(objRecordSet.EOF) Then strPageContent = Trim(objRecordSet("PageContent")) End If objRecordSet.Close Set objRecordSet = Nothing Call DisconnectFromDatabase() blnShowCatalogSearch = True Call CreatePageTop(strRelativePath,"GenericValidation","Catalog","Catalog.asp","POST","ExecuteSearch","Online Store") %> <% If (strFormAction = "onLoad") Then ' SHOW THE FEATURED ITEMS %>
Beautiful Ballerinas Video Offer!
<% 'Call ShowCenterStageItems(4, "") ' Display List of 'Center Stage' items Call ShowCenterStageItems_Revised("") %>
<% End if %> <% Call CreatePageBottom(strRelativePath) '================================================================================================== ' Perform Search/Browse of Products '================================================================================================== Case "ExecuteSearch", "Browse", "SingleItem": Dim strDisplayItemFileName, strItemDescription, strItemBriefDescription, intItemCount Dim currentPage, totalPages Dim strSortColumn Dim strBasePrice 'Records displayed per page Const recordsPerPage =10 Const setsPerPage = 5 blnShowCatalogSearch = True strSearchID = trim(request.querystring("SearchID")) strSearchText = FormatforSQL(trim(request.form("Search_Text"))) strSearchFields = trim(request.form("Search_Fields")) strSearchCategories = trim(request.form("Search_Category")) 'IF it is empty than the search category must be from the template If strSearchCategories = "" Then strSearchCategories = request.Form("Search_Category_Template") End If strSearchCategoryList = trim(request.form("Search_Category_List")) If (Trim(strSearchCategoryList) = "") Then ' Checks second value in case page was reloaded strSearchCategoryList = trim(request.form("Search_Category_List2")) End if strUnorderedSQL = request.form("sqlUnordered") strOrderByClause = request.form("orderByClause") If strOrderByClause = "" Then strOrderByClause = strLanguage & "CategoryName Asc" End If 'Retrieve what page we're currently on If Request.Form("pageToView") = "" then currentPage = 1 'We're on the first page Else currentPage = CInt(Request.Form("pageToView")) End If strAlternatingColor = "#000000" Function filterByFields(strFieldsToSearch) Dim strSQLFilter strSQLFilter = strSQLFilter & "(" &_ replace(strFieldsToSearch,", "," Like '%" & strSearchText & "%' OR ") &_ " Like '%" & strSearchText & "%')" filterByFields = strSQLFilter End Function If request.form("Clear_strUnorderedSQL") = "1" Then strUnorderedSQL = "" End If If strUnorderedSQL = "" Then strUnorderedSQL = "SELECT SC_Items.*, SC_ItemCategories." & strLanguage & "CategoryName" &_ " FROM SC_ItemCategories INNER JOIN SC_Items ON SC_ItemCategories.CategoryID = SC_Items.CategoryID WHERE Active=true" If strSearchCategoryList <> "" Then strUnorderedSQL = strUnorderedSQL & " AND SC_Items.CategoryID=" & strSearchCategoryList Else If strSearchFields <> "" Then strUnorderedSQL = strUnorderedSQL & " AND " & filterByFields(strSearchFields) Else strUnorderedSQL = strUnorderedSQL & " AND (1=1)" End If If strSearchID <> "" Then strUnorderedSQL = strUnorderedSQL & " AND (ItemNumber In ('" & Replace(strSearchID,",","','") & "'))" End If If strSearchCategories <> "" Then strUnorderedSQL = strUnorderedSQL & " AND SC_Items.CategoryID In (" & strSearchCategories & ")" End If End If End if ' Changed condition since we now input where the item is to appear, 1 = SV, 2 = TC, 3 = both strUnorderedSQL = strUnorderedSQL & " AND (DisplayCategory = 1 OR DisplayCategory = 3)" strRetrieveItems = strUnorderedSQL & " ORDER BY " & strLanguage & "ItemName" Call ConnectToDatabase() Set objSearchResults = Server.CreateObject("ADODB.RecordSet") 'Set the cursor location property objSearchResults.CursorLocation = 3 ' adUseClient 'Set the cache size = to the # of records/page objSearchResults.CacheSize = recordsPerPage 'Set the page size to the const declared for number of records per page objSearchResults.PageSize = recordsPerPage 'Create the SQL statement to retrieve the data objSearchResults.open strRetrieveItems, myConnection If Not objSearchResults.EOF Then objSearchResults.MoveFirst 'Get the max number of pages totalPages = objSearchResults.PageCount 'Set the absolute page objSearchResults.AbsolutePage = currentPage End If If objSearchResults.RecordCount = 0 Then blnShowCatalogSearch = True End If Call CreatePageTop(strRelativePath,"GenericValidation","Catalog","Catalog.asp","POST","ExecuteSearch","Online Store") %>

<% If (strSearchCategoryList <> "") Then %>

<% Call ShowCenterStageItems(4, strSearchCategoryList) ' Display List of 'Center Stage' items %>


<% End if %> <% If strFormAction="ShowSearchForm" Then %> Search Results (<%= objSearchResults.RecordCount %> item(s))
<% End If %> <% If totalPages > 0 Then intRowCounter = 0 %>

Search Results
Your search has returned <%= objSearchResults.RecordCount %> Item(s).
 

<% Call DisplayRecordNavigation( "Catalog" , "" , "Catalog" , "ExecuteSearch","#222288") %> <% 'Display Next / Prev buttons If currentPage > 1 Then 'We are not at the beginning, show the prev button %> <% If currentpage <> 1 Then %>< Last <%= recordsPerPage %> Items <% End If %> <% End If If currentPage > 1 AND CInt(currentPage) <> CInt(totalPages) Then response.write " | " End If If CInt(currentPage) <> CInt(totalPages) Then 'We are not at the end, show a next button %> <% if currentpage = totalPages - 1 Then %>Next <%= objSearchResults.recordCount - ((totalPages - 1) * recordsPerPage) %> Items > <% Else %>Next <%= recordsPerPage %> Items > <% End If %> <% End If %>

<% If objSearchResults.RecordCount = 0 Then %> <% Else Do While Not objSearchResults.EOF And intRowCounter < objSearchResults.PageSize If (intRowCounter mod 2) > 0 Then strAlternatingColor="#cccccc" Else strAlternatingColor="#eeeeee" End If strItemID = objSearchResults("ItemID") strItemNumber = objSearchResults("ItemNumber") strCategory = objSearchResults(strLanguage & "CategoryName") strName = objSearchResults(strLanguage & "ItemName") strPrice = objSearchResults("ItemPrice") If Session("public_MemberID") <> "" Then strBasePrice = strPrice strPrice = strPrice - (strPrice * 0.25) End If strDisplayItemFileName = objSearchResults(""& strLanguage &"ItemFileName") strItemDescription = objSearchResults(""& strLanguage &"ItemDescription") strItemBriefDescription = objSearchResults(""& strLanguage &"ItemBriefDescription") %> <% intRowCounter = intRowCounter + 1 objSearchResults.MoveNext Loop End if %> <% 'Display Next / Prev buttons If currentPage > 1 Then 'We are not at the beginning, show the prev button %> <% End If %>

Currently no products available.
View Product <%= strCategory %>
<%= strName %>
<% if Trim(strItemBriefDescription) = "" then response.write strItemDescription else response.write strItemBriefDescription end if %>
<%= FormatCurrency(strPrice) %> <% If Session("public_MemberID") <> "" Then %> Reg. <%= FormatCurrency(strBasePrice) %>

<% End If %>


<% If currentpage <> 1 Then %>< Last <%= recordsPerPage %> Items <% End If %> <% End If If currentPage > 1 AND CInt(currentPage) <> CInt(totalPages) Then response.write " | " End If If CInt(currentPage) <> CInt(totalPages) Then 'We are not at the end, show a next button %>
<% if currentpage = totalPages - 1 Then %>Next <%= objSearchResults.recordCount - ((totalPages - 1) * recordsPerPage) %> Items > <% Else %>Next <%= recordsPerPage %> Items > <% End If %>

<% Else %>
No items were found.
Please click here to search again.
<% End If %>
<% objSearchResults.Close Set objSearchResults = Nothing Call CreatePageBottom(strRelativePath) '============================================================================================================ ' 'Enter Personal Info' page '============================================================================================================ Case "GetPersonalInfo": Dim strMemberFirstName, strMemberLastName, strMemberEmail, strAddress1, strAddress2 Dim strMemberCity, strMemberInternational, strMemberFax, strMemberTel, strMemberPostal Dim strMemberCountryID, strMemberProvinceID, strMemberStateID If CInt(Session("public_NumberOfItemsInCart")) = 0 Then 'Session has timed out and user is redirected to the shopping cart %> Your shopping session has timed out.
Please wait ...
<% Else Dim arrProvince() 'Array of Provinces Dim intProvinceCount 'Length of Province Array Dim arrState() 'Array of States Dim intStateCount 'Length of State Array Dim arrCountry() 'Array of Countries Dim intCountryCount 'Length of Country Array Dim strUserMemberLevel Call ConnectToDatabase() 'IF A CORPORATE MEMBER IS LOGGED IN AUTO FILL PERSONAL INFORMATION Dim blnGetDataFromDB blnGetDataFromDB = False If intCorporateMemberID <> "" Then strSQL = "SELECT Members.FirstName AS MemberFirstName, Members.LastName AS MemberLastName, Members.Email AS MemberEmail, Members.UserLevel AS MemberUserLevel, CorporateMembers.StreetAddress AS Address1, CorporateMembers.StreetAddressLine2 AS Address2, CorporateMembers.City AS MemberCity, CorporateMembers.ProvinceID AS MemberProvinceID, CorporateMembers.StateID AS MemberStateID, CorporateMembers.CountryID AS MemberCountryID, CorporateMembers.InternationalRegion AS MemberInternational, CorporateMembers.Fax AS MemberFax, CorporateMembers.Telephone AS MemberTelephone, CorporateMembers.PostalCode AS MemberPostal FROM CorporateMembers INNER JOIN Members ON CorporateMembers.MemberID = Members.MemberID WHERE Members.MemberID = "& intCorporateMembersMemberID &"" Set objRecordSet = Server.CreateObject("ADODB.RecordSet") Set objRecordSet = GetRSFromDatabase(strSQL) blnGetDataFromDB = True ElseIf intIndividualMembersMemberID <> "" Then strSQL = "SELECT IndividualMembers.FirstName AS MemberFirstName, IndividualMembers.LastName AS MemberLastName, IndividualMembers.Email AS MemberEmail, IndividualMembers.StreetAddress AS Address1, IndividualMembers.StreetAddressLine2 AS Address2, IndividualMembers.City AS MemberCity, IndividualMembers.ProvinceID AS MemberProvinceID, IndividualMembers.StateID AS MemberStateID, IndividualMembers.CountryID AS MemberCountryID, IndividualMembers.InternationalRegion AS MemberInternational, IndividualMembers.Fax AS MemberFax, IndividualMembers.Telephone AS MemberTelephone, IndividualMembers.PostalCode AS MemberPostal FROM IndividualMembers WHERE IndividualMembers.IndividualMemberID = "& intIndividualMembersMemberID &"" Set objRecordSet = Server.CreateObject("ADODB.RecordSet") Set objRecordSet = GetRSFromDatabase(strSQL) blnGetDataFromDB = True End If If blnGetDataFromDB Then If Not objRecordSet.EOF Then strMemberFirstName = Trim(objRecordSet("MemberFirstName")) strMemberLastName = Trim(objRecordSet("MemberLastName")) strMemberEmail = Trim(objRecordSet("MemberEmail")) strAddress1 = Trim(objRecordSet("Address1")) strAddress2 = Trim(objRecordSet("Address2")) strMemberCity = Trim(objRecordSet("MemberCity")) strMemberInternational = Trim(objRecordSet("MemberInternational")) strMemberFax = Trim(objRecordSet("MemberFax")) strMemberTel = Trim(objRecordSet("MemberTelephone")) strMemberPostal = Trim(objRecordSet("MemberPostal")) strMemberCountryID = Trim(objRecordSet("MemberCountryID")) strMemberProvinceID = Trim(objRecordSet("MemberProvinceID")) strMemberStateID = Trim(objRecordSet("MemberStateID")) If intCorporateMemberID <> "" Then strUserMemberLevel = Trim(objRecordSet("MemberUserLevel")) End If End If End If If strMemberFirstName = "" Then Dim strFullName, strDelimiterOne strFullName = Session("public_FullName") strMemberFirstName = Session("public_FirstName") strMemberLastName = Trim(Replace(strFullName, strMemberFirstName,"")) strMemberEmail = Session("public_EmailAddress") End If ' GET PROVINCE LIST strSQL = "SELECT ProvinceID, "& strLanguage &"Province AS FirstLanguageProvince FROM Provinces WHERE (ProvinceID <>14) ORDER BY EnglishProvince" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection, adOpenKeySet intProvinceCount = objRecordSet.RecordCount Redim arrProvince(intProvinceCount,2) For i=1 to intProvinceCount Step 1 arrProvince(i,1) = objRecordSet("ProvinceID") arrProvince(i,2) = objRecordSet("FirstLanguageProvince") objRecordSet.MoveNext Next ' GET STATE LIST strSQL = "SELECT StateID, StateName FROM States WHERE (StateID <>54) ORDER BY StateName ASC" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection, adOpenKeySet intStateCount = objRecordSet.RecordCount Redim arrState(intStateCount,2) For i=1 to intStateCount Step 1 arrState(i,1) = objRecordSet("StateID") arrState(i,2) = objRecordSet("StateName") objRecordSet.MoveNext Next ' GET COUNTRY LIST strSQL = "SELECT CountryID, Country FROM Countries ORDER BY Country" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection, adOpenKeySet intCountryCount = objRecordSet.RecordCount Redim arrCountry(intCountryCount,2) For i=1 to intCountryCount Step 1 arrCountry(i,1) = objRecordSet("CountryID") arrCountry(i,2) = objRecordSet("Country") objRecordSet.MoveNext Next objRecordSet.Close Call CreatePageTop(strRelativePath,"GenericValidation","Catalog","Catalog.asp","POST","SubmitOrder","Online Store") %>

Welcome. Please enter your information below for order processing...

PERSONAL INFORMATION
FIRST NAME
*
LAST NAME
*
ADDRESS
*
ADDRESS
*
CITY
*
PROVINCE/STATE
*
* If "International", please specify:
*
POSTAL/ZIP CODE
*
COUNTRY
*
TELEPHONE
*
FAX
*
EMAIL
*

SHIPPING INFORMATION *
SHIPPING ADDRESS
*
SHIPPING ADDRESS 2
*
SHIPPING CITY
*
SHIPPING PROVINCE/STATE
*
*If "International", please specify:
*
SHIPPING POSTAL/ZIP CODE
*
COUNTRY
*

PAYMENT OPTIONS
<% If strUserMemberLevel = "CorporateMember" Then %> <% End If %>
Certified or Personal Cheque, money order or bank draft
(make payable to: "<%= ClientCompanyName %>")
Purchase Order #:
Credit Card   Visa MasterCard Amex Discover
 

  

for (var i = 0; i < this.form.optPayment.length; i++){ if ((this.form.optPayment[i].checked == true) && (i == 1) && (this.form.PONumber.value == '')){ alert('Please enter a Purchase Order Number'); return false; } } <% End If %> if (((this.form._06_select_Province[this.form._06_select_Province.selectedIndex].value == 'International') && (this.form._07_Province_International.value == '')) || ((this.form._16_select_Shipping_Province[this.form._16_select_Shipping_Province.selectedIndex].value == 'International') && (this.form._17_Province_Shipping_International.value == ''))) { strAdditionalError = ' - Please specify the province/state/region in the text field.\n'; } var strAdditionalError = ''; var strPostalCodeString = frmCurrentForm._08_mandatory_Postal_Code.value.toString(); strPostalCodeString = strPostalCodeString.replace(/\s/g,''); frmCurrentForm._08_mandatory_Postal_Code.value = strPostalCodeString; strRetVal = isFieldAlphanumeric(strPostalCodeString,'Postal Code',false); if (strRetVal != 'valid') { strAdditionalError += ' - ' + strRetVal + '\n'; setFirstBadField( frmCurrentForm._08_mandatory_Postal_Code ); markField(frmCurrentForm._08_mandatory_Postal_Code,'#DDDDFF','12','visible'); } else if ((strPostalCodeString.length < 5) && (strPostalCodeString.length > 10)) { strAdditionalError += ' - Postal code must be between 5 and 10 characters in length.\n'; setFirstBadField( frmCurrentForm._08_mandatory_Postal_Code ); markField(frmCurrentForm._08_mandatory_Postal_Code,'#DDDDFF','12','visible'); } strPostalCodeString = frmCurrentForm._18_mandatory_Shipping_Postal_Code.value.toString(); strPostalCodeString = strPostalCodeString.replace(/\s/g,''); frmCurrentForm._18_mandatory_Shipping_Postal_Code.value = strPostalCodeString; strRetVal = isFieldAlphanumeric(strPostalCodeString,'Postal Code',false); if (strRetVal != 'valid') { strAdditionalError += ' - ' + strRetVal + '\n'; setFirstBadField( frmCurrentForm._18_mandatory_Shipping_Postal_Code ); markField(frmCurrentForm._18_mandatory_Shipping_Postal_Code,'#DDDDFF','12','visible'); } else if ((strPostalCodeString.length < 5) && (strPostalCodeString.length > 10)) { strAdditionalError += ' - Postal code must be between 5 and 10 characters in length.\n'; setFirstBadField( frmCurrentForm._18_mandatory_Shipping_Postal_Code ); markField(frmCurrentForm._18_mandatory_Shipping_Postal_Code,'#DDDDFF','12','visible'); } if (strAdditionalError != '') { strAdditionalError += '\n';} if (isReadyToSubmit(frmCurrentForm,'','',strAdditionalError)) { frmCurrentForm.submit(); } } ">

<% Call CreatePageBottom(strRelativePath) End if '============================================================================================================ ' 'Enter Credit Card Info' page '============================================================================================================ Case "SubmitOrder": Dim timeProcessed 'The time at which the order is inserted into the database completely Dim strShipMethod, strShipPrice Dim strUniqueID 'ID created using date, time, random number (0 --> 9999) Dim strCustomerFirstName Dim strCustomerLastName Dim strCustomerAddress Dim strCustomerAddress2 Dim strCustomerCity Dim strCustomerProvince Dim strCustomerState Dim strCustomerProvinceInternational Dim strCustomerPostalCode Dim strCustomerCountry Dim strCustomerTelephone Dim strCustomerFax Dim strCustomerEmail Dim strShippingConcatenatedAddress Dim strCustomerShippingAddress Dim strCustomerShippingAddress2 Dim strCustomerShippingCity Dim strCustomerShippingProvince Dim strCustomerShippingState Dim strCustomerShippingProvinceInternational Dim strCustomerShippingPostalCode Dim strCustomerShippingCountry Dim strShippingMethodID Dim strCustomerID Dim strCountryCode Dim strProvinceID Dim strOrderID Dim strCourierName, strCourierAccount, strCourierDeliveryType Dim dblPricePST, dblPriceGST, dblPriceHST Dim strProvinceState, strTempCountry Dim strTaxlabel Dim intNumberOfTapes Dim strPaymentOption Dim blnPurchaseOrder Dim strPONumber Dim strPaymentMethod Dim strProductCodeTax ' GET UNIQUE ID FOR CUSTOMER Randomize() strUniqueID = Chr(Hour(Time()) + 65) & Chr((Minute(Time()) mod 26) + 65) & Chr((Second(Time()) mod 26)+ 65) & "-" & Replace(Date(),"/","") & "-" & CInt(10000 * Rnd()) ' GET SHOPPONG CART ITEMS INFO intNumberOfItemsInCart = Session("public_NumberOfItemsInCart") arrShoppingCart = Session("public_ShoppingCart") ' GET PAYMENT OPTION strPaymentOption = Trim(Request.form("optPayment")) 'Get the Payment Method so it can be inserted into the datbase If strPaymentOption = 1 Then strPaymentMethod = "CreditCard" ElseIf strPaymentOption = 2 Then strPaymentMethod = "Cheque" ElseIf strPaymentOption = 3 Then strPaymentMethod = "PurchaseOrder" strPONumber = Trim(Request.Form("PONumber")) End If If CInt(intNumberOfItemsInCart) = 0 Then 'Session has timed out and user is redirected to the shopping cart %>

Your shopping session has timed out.
Please wait ...

<% Else 'Process this checkout Call ConnectToDatabase() If CInt(Session("public_NumberOfItemsInCart")) = 0 Then %>

Your session has timed out.
Please wait ...

<% Else Dim intShippingMethodCount 'Length of State Array Dim strCurrentMonth, strCurrentYear Dim dblShippingAmount, dblShippingTotal Dim strCountryID Dim shippingType ' Get Shopping Cart Items Info intNumberOfItemsInCart = Session("public_NumberOfItemsInCart") arrShoppingCart = Session("public_ShoppingCart") strCountryID = Trim(request.form("_09_select_Country")) dblShippingAmount = 0.00 intTotalNumOfItems = 0 intNumberOfTapes = 0 Dim strHiddenProductCode, strItemName, strTemp, strItemUniqueID, strItemQuantity Dim finalProductCode ' Loop through Shopping Cart array to establish total quantity and price If intNumberOfItemsInCart > 0 Then 'strItemNumber For i = 1 to intNumberOfItemsInCart intTotalNumOfItems = intTotalNumOfItems + Cint(arrShoppingCart(i, itemQuantity)) ' Each package has a certain number of tapes intNumberOfTapes = intNumberOfTapes + (intTotalNumOfItems * Cint(arrShoppingCart(i, itemNumberOfComponents))) Next End if Dim dblAmount1To3, dblAmount4To6, dblAmount7To10, dblAmountOver10 Dim dblAmount1To2, dblAmount3To5, dblAmount6To9 If strCountryID = "38" Then ' Canada shipping dblAmount1To2 = 8.95 ' $6.95 CDN dblAmount3To5 = 10.95 ' $8.50 CDN dblAmount6To9 = 13.95 ' $10.00 CDN dblAmountOver10 = 40.00 ' $12.95 CDN If (intTotalNumOfItems > 0) And (intTotalNumOfItems < 3) Then ' 1-2 tapes dblShippingAmount = dblAmount1To2 Elseif (intTotalNumOfItems > 2) And (intTotalNumOfItems < 6) Then ' 3-5 tapes dblShippingAmount = dblAmount3To5 Elseif (intTotalNumOfItems > 5) And (intTotalNumOfItems < 10) Then ' 6-9 tapes dblShippingAmount = dblAmount6To9 Else ' >= 10 Tapes dblShippingAmount = dblAmountOver10 End if ElseIf strCountryID = "226" Then ' USA shipping dblAmount1To3 = 9.95 ' $9.95 CDN dblAmount4To6 = 12.95 ' $12.95 CDN dblAmount7To10 = 16.95 ' $16.95 CDN dblAmountOver10 = 50.00 If (intTotalNumOfItems > 0) And (intTotalNumOfItems < 4) Then ' 1-3 tapes dblShippingAmount = dblAmount1To3 Elseif (intTotalNumOfItems > 3) And (intTotalNumOfItems < 7) Then ' 4-6 tapes dblShippingAmount = dblAmount4To6 Elseif (intTotalNumOfItems > 6) And (intTotalNumOfItems < 11) Then ' 7-10 tapes dblShippingAmount = dblAmount7To10 Else ' > 10 Tapes dblShippingAmount = dblAmountOver10 End if Else ' International shipping dblAmount1To3 = 19.95 ' $20.00 CDN dblAmount4To6 = 27.95 ' $28.00 CDN dblAmount7To10 = 34.95 ' $35.00 CDN dblAmountOver10 = 100.00 If (intTotalNumOfItems > 0) And (intTotalNumOfItems < 4) Then ' 1-3 tapes dblShippingAmount = dblAmount1To3 Elseif (intTotalNumOfItems > 3) And (intTotalNumOfItems < 7) Then ' 4-6 tapes dblShippingAmount = dblAmount4To6 Elseif (intTotalNumOfItems > 6) And (intTotalNumOfItems < 11) Then ' 7-10 tapes dblShippingAmount = dblAmount7To10 Else ' > 10 Tapes dblShippingAmount = dblAmountOver10 End if End if 'for some reason, shipping variables were being set all over the place in here, so we'll set them all to dblShippingAmount strShipPrice = dblShippingAmount dblTotalShippingCost = dblShippingAmount 'response.write dblShippingAmount End If strCustomerFirstName = Trim(request.form("_01_mandatory_First_Name")) strCustomerLastName = Trim(request.form("_02_mandatory_Last_Name")) strCustomerAddress = Trim(request.form("_03_mandatory_Address")) strCustomerAddress2 = Trim(request.form("_04_Address2")) strCustomerCity = Trim(request.form("_05_mandatory_City")) strCustomerProvince = CheckProvinceID(Trim(request.form("_06_select_Province")), "p") strCustomerState = CheckProvinceID(Trim(request.form("_06_select_Province")), "s") strCustomerProvinceInternational = Trim(request.form("_07_Province_International")) strCustomerPostalCode = Trim(request.form("_08_mandatory_Postal_Code")) strCustomerCountry = Trim(request.form("_09_select_Country")) strCustomerTelephone = Trim(request.form("_10_mandatory_Telephone")) strCustomerFax = Trim(request.form("_11_Fax")) strCustomerEmail = Trim(request.form("_12_mandatory_email_Email")) strCustomerShippingAddress = Trim(request.form("_13_mandatory_Shipping_Address")) strCustomerShippingAddress2 = Trim(request.form("_14_Shipping_Address2")) strCustomerShippingCity = Trim(request.form("_15_mandatory_Shipping_City")) strCustomerShippingProvince = CheckProvinceID(Trim(request.form("_16_select_Shipping_Province")), "p") strCustomerShippingState = CheckProvinceID(Trim(request.form("_16_select_Shipping_Province")), "s") strCustomerShippingProvinceInternational = Trim(request.form("_17_Province_Shipping_International")) strCustomerShippingPostalCode = Trim(request.form("_18_mandatory_Shipping_Postal_Code")) strCustomerShippingCountry = Trim(request.form("_19_select_Shipping_Country")) strShippingMethodID = Trim(request.form("shippingMethod")) strCourierName = Trim(request.form("courierName")) strCourierAccount = Trim(request.form("courierAccount")) strCourierDeliveryType = Trim(request.form("courierDeliveryType")) dblPriceTotal = 0.00 dblPriceSubTotal = 0.00 dblPriceGST = 0.00 dblPricePST = 0.00 intTotalNumOfItems = 0 ' Loop through Shopping Cart array to establish total quantity and price If intNumberOfItemsInCart > 0 Then 'strItemNumber For i = 1 to intNumberOfItemsInCart dblPriceSubTotal = dblPriceSubTotal + (Cdbl(arrShoppingCart(i, itemPrice)) * Cint(arrShoppingCart(i, itemQuantity))) intTotalNumOfItems = intTotalNumOfItems + Cint(arrShoppingCart(i, itemQuantity)) Next End if dim CalcTotals set CalcTotals = new clsCalcTotals with CalcTotals .SubTotal = dblPriceSubTotal .ItemCount = intNumberOfTapes * 2 .CountryCode = strCustomerCountry .Calculate dblPriceGST = .Taxes dblPriceTotal = .Total end with set CalcTotals = nothing ' Set 'strProvinceState' var to whichever prov/state was entered If strCustomerShippingProvince <> "14" Then strProvinceState = GetProvStateCountryName(strCustomerShippingProvince, "p") Elseif strCustomerShippingState <> "54" Then strProvinceState = GetProvStateCountryName(strCustomerShippingState, "s") Else strProvinceState = strCustomerShippingProvinceInternational End if strTempCountry = GetProvStateCountryName(strCustomerShippingCountry, "c") strShippingConcatenatedAddress=strCustomerShippingAddress & vbCrLf If (strCustomerShippingAddress2<>"") Then strShippingConcatenatedAddress = strShippingConcatenatedAddress & " " & strCustomerShippingAddress2 & vbCrLf End If strShippingConcatenatedAddress = strShippingConcatenatedAddress &_ " " & strCustomerShippingCity & vbCrLf &_ " " & strProvinceState & vbCrLf &_ " " & strCustomerShippingPostalCode & vbCrLf &_ " " & strTempCountry ' IF PAYMENT OPTION IS DONE BY CREDIT CARD If strPaymentOption = 1 or strPaymentOption = 2 Then If request.form("shippingMethod") = 2 then shippingType = request.form("courierName") else shippingType = "Standard Shipping" end If If strCourierDeliveryType = "" Then strCourierDeliveryType = "Default" End If Dim strTempProduct, str1ProductString, strMultipleProductCode Dim intQuantityCount ' FIXED SHIPPING CHARGE Dim intFixQuantity intFixQuantity = 1 Dim strPurchasedItems strSQL = "INSERT INTO SC_Customers (CustomerUniqueID, FirstName, LastName, StreetAddress, StreetAddress2, City, ProvinceID, StateID, OtherRegion, CountryID, PostalCode, Telephone, Fax, Email, ShippingStreetAddress, ShippingStreetAddress2, ShippingCity, ShippingProvinceID, ShippingStateID, ShippingOtherRegion, ShippingCountryID, ShippingPostalCode) VALUES ('" &_ strUniqueID & "','" &_ strCustomerFirstName & "','" &_ FormatForSQL(strCustomerLastName) & "','" &_ FormatForSQL(strCustomerAddress) & "','" &_ FormatForSQL(strCustomerAddress2) & "','" &_ FormatForSQL(strCustomerCity) & "'," &_ strCustomerProvince & "," &_ strCustomerState & ",'" &_ FormatForSQL(strCustomerProvinceInternational) & "'," &_ strCustomerCountry & ",'" &_ FormatForSQL(strCustomerPostalCode) & "','" &_ FormatForSQL(strCustomerTelephone) & "','" &_ FormatForSQL(strCustomerFax) & "','" &_ FormatForSQL(strCustomerEmail) & "','" &_ FormatForSQL(strCustomerShippingAddress) & "','" &_ FormatForSQL(strCustomerShippingAddress2) & "','" &_ FormatForSQL(strCustomerShippingCity) & "'," &_ strCustomerShippingProvince & "," &_ strCustomerShippingState & ",'" &_ FormatForSQL(strCustomerShippingProvinceInternational) & "'," &_ strCustomerShippingCountry & ",'" &_ FormatForSQL(strCustomerShippingPostalCode) & "')" myConnection.execute(strSQL) 'GET RECORD ID OF CUSTOMER strSQL="SELECT SC_Customers.CustomerID, Countries.[2_Letter_AB] AS ContryCode, SC_Customers.ProvinceID FROM Countries INNER JOIN SC_Customers ON Countries.CountryID = SC_Customers.CountryID WHERE (CustomerUniqueID='" & strUniqueID & "')" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection, adOpenKeySet strCustomerID = objRecordSet("CustomerID") strCountryCode = trim(objRecordSet("ContryCode")) strProvinceID = trim(objRecordSet("ProvinceID")) objRecordSet.Close if (strCountryCode = "CA") then 'Calculate the shippping cost for Canada ' if intTotalNumOfItems > 10 Then ' strShipPrice = 12.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' strShipPrice = 8.50 ' else ' strShipPrice = 6.95 ' End If 'If the province are NB, NS or PEI than charge HST (15 percent) and insert and if Ontario charge GST and PST if strProvinceID = 4 or strProvinceID = 7 or strProvinceID = 9 or strProvinceID = 10 Then if strProvinceID = 9 Then strProductCodeTax = "{GST}{PST}" dblPriceHST = 0 dblPriceGST = dblPriceSubTotal * 0.05 dblPricePST = dblPriceSubTotal * 0.08 dblPriceTotal = dblPriceSubTotal + strShipPrice + dblPricePST + dblPriceGST else strProductCodeTax = "{HST}" dblPriceGST = 0 dblPricePST = 0 dblPriceHST = dblPriceSubTotal * 0.13 dblPriceTotal = dblPriceSubTotal + strShipPrice + dblPriceHST end if else 'Charge only GST for any other province strProductCodeTax = "{GST}" dblPriceHST = 0 dblPricePST = 0 dblPriceGST = dblPriceSubTotal * 0.05 dblPriceTotal = dblPriceSubTotal + strShipPrice + dblPriceGST end if ' united state shipping elseif (strCountryCode = "US") then strProductCodeTax = "" dblPriceGST = 0.00 dblPriceHST = 0 dblPricePST = 0 ' if intTotalNumOfItems => 7 Then ' strShipPrice = 16.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' strShipPrice = 12.95 ' else ' strShipPrice = 9.95 ' End If dblPriceTotal = dblPriceSubTotal + strShipPrice ' international shipping else strProductCodeTax = "" dblPriceGST = 0.00 dblPriceHST = 0 dblPricePST = 0 ' if intTotalNumOfItems => 7 Then ' strShipPrice = 34.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' strShipPrice = 27.95 ' else ' strShipPrice = 19.95 ' End If dblPriceTotal = dblPriceSubTotal + strShipPrice end if If intNumberOfItemsInCart > 0 Then 'strItemNumber For i = 1 to intNumberOfItemsInCart strItemPrice= (arrShoppingCart(i,itemPrice)) strItemName = (arrShoppingCart(i,itemName)) strItemUniqueID = (arrShoppingCart(i,itemUniqueID)) strItemQuantity = (arrShoppingCart(i,itemQuantity)) 'Temp Multiple items for product code to send to internet secure strTempProduct = strItemPrice & "::" & strItemQuantity & "::" & strItemUniqueID & "::" & strItemName & "::" & strProductCodeTax & TRANSACTION_MODE 'Single item for product code to send to internet secure str1ProductString = strItemPrice & "::" & strItemQuantity & "::" & strItemUniqueID & "::" & strItemName & "::" & strProductCodeTax & TRANSACTION_MODE & "|" & strShipPrice & "::" & intFixQuantity & "::" & shippingType & "::" & strCourierDeliveryType & "::" & TRANSACTION_MODE strMultipleProductCode = strMultipleProductCode & "|" & strTempProduct strPurchasedItems = "
" & "     " & strItemName & " " & strPurchasedItems Next End If 'FINAL PRODUCT STRING TO SEND TO INTERNET SECURE IF THERE IS ONLY ONE ITEM If intNumberOfItemsInCart = 1 Then If dblPriceSubTotal = 0 Then strPurchasedItems = "Shipping and handling fee for test items : " & "    " & strPurchasedItems finalProductCode = replace(str1ProductString, "Default", strPurchasedItems) Else 'finalProductCode = str1ProductString finalProductCode = replace(str1ProductString, "Default", "Standard") End If End If 'FINAL PRODUCT STRING TO SEND TO INTERNET SECURE IF THERE IS MORE THAN ONE ITEM If intNumberOfItemsInCart > 1 Then If dblPriceSubTotal = 0 Then strPurchasedItems = "Shipping and handling fee for these items : " & " " & strPurchasedItems finalProductCode = mid(strMultipleProductCode,2,len(strMultipleProductCode)) & "|" & strShipPrice & "::" & intFixQuantity & "::" & shippingType & "::" & strPurchasedItems & "::" & TRANSACTION_MODE Else strCourierDeliveryType = "Standard" finalProductCode = mid(strMultipleProductCode,2,len(strMultipleProductCode)) & "|" & strShipPrice & "::" & intFixQuantity & "::" & shippingType & "::" & strCourierDeliveryType & "::" & TRANSACTION_MODE End If End If End If If strShippingMethodID = "1" Then ' Values passed through don't get added to DB for standard courier strCourierName = "" strCourierAccount = "" strCourierDeliveryType = "" Elseif strShippingMethodID = "2" Then ' Values passed through don't get added to DB for courier account strShipPrice = "0" End if 'money - was cstr for access strSQL = "INSERT INTO SC_Orders (OrderUniqueID, CustomerID, OrderNumOfItems, OrderSubTotal, OrderGST, OrderPST, orderHST, OrderTotal, ShippingMethodID, ShippingAmount, CourierName, CourierAccount, CourierDeliveryType, PaymentMethod, PONumber, PaymentStatus) VALUES ('" &_ strUniqueID & "'," &_ strCustomerID & "," &_ Cstr(intTotalNumOfItems) & ",'" &_ Cstr(dblPriceSubTotal) & "','" &_ Cstr(dblPriceGST) & "','" &_ Cstr(dblPricePST) & "','" &_ Cstr(dblPriceHST) & "','" &_ Cstr(dblPriceTotal) & "'," &_ strShippingMethodID & ",'" &_ Cstr(strShipPrice) & "'," &_ "'" & strCourierName & "'," &_ "'" & FormatForSQL(strCourierAccount) & "','" &_ strCourierDeliveryType & "'," &_ "'" & strPaymentMethod & "'," &_ "'" & strPONumber & "'," &_ TRANSC_STATUS_DEFAULT & ")" myConnection.execute(strSQL) 'If the payment option is made with purchase order update the database so that the order is pending If strPaymentOption = 3 Then strSQL = "Update SC_Orders Set PaymentStatus = " & PURCHASE_ORDER_PENDING & " where OrderUniqueID = '" & strUniqueID & "'" myConnection.errors.Clear Call ExecuteOnDatabase(strSQL) End If 'GET RECORD ID OF ORDER strSQL = "SELECT OrderID FROM SC_Orders WHERE (OrderUniqueID='" & strUniqueID & "')" 'display (strSQL) 'response.end set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection, adOpenKeySet strOrderID = objRecordSet("OrderID") objRecordSet.Close 'Initialize <> string for emailing order Dim strMailItems strMailItems = "" ' LOOP THOUGH SHOPPING-CART ARRAY TO ESTABLISH TOTAL QUANTITY AND PRICE If intNumberOfItemsInCart > 0 Then For i = 1 to intNumberOfItemsInCart if arrShoppingCart(i, itemExtraInput) = "" OR isNull(arrShoppingCart(i, itemExtraInput)) then arrShoppingCart(i, itemExtraInput) = "null" else arrShoppingCart(i, itemExtraInput) = "'" & FormatForSQL(arrShoppingCart(i, itemExtraInput)) & "'" end if strSQL = "INSERT INTO SC_orders_items (OrderID, ItemID, ItemQuantity, ExtraInfo) VALUES (" &_ strOrderID & "," &_ Cstr(arrShoppingCart(i, itemID)) & "," &_ Cstr(arrShoppingCart(i, itemQuantity)) & ", " &_ arrShoppingCart(i, itemExtraInput) & ")" strMailItems = strMailItems & "ITEM #" & i & "" & vbCrLf &_ " " & "ID: " & vbCrLf & " " & arrShoppingCart(i, itemUniqueID) & vbCrLf &_ " " & "NAME/DESCRIPTION: " & vbCrLf & " " & arrShoppingCart(i, itemName) & vbCrLf &_ " " & "UNIT PRICE: " & vbCrLf & " " & FormatCurrency(arrShoppingCart(i, itemPrice)) & vbCrLf &_ " " & "QUANTITY: " & vbCrLf & " " & arrShoppingCart(i, itemQuantity) & vbCrLf myConnection.execute(strSQL) Next End if timeProcessed = Replace(Now(), Date(), Month(Date()) & "/" & Day(Date()) & "/" & Year(Date())) 'Get the Country, State, and Province abbreviations to prepopulate the Internet Secure form Dim strCountryAbbreviation, strStateAbbreviation, strProvinceAbbreviation 'Retrieve Province, state, and Country Abbreviations strSQL = "SELECT States.StateAbbreviation AS StateAb From States WHERE States.StateID="& strCustomerState &"" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection strStateAbbreviation = objRecordSet("StateAb") strSQL = "SELECT * From Countries WHERE Countries.CountryID = " & strCustomerCountry & "" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection strCountryAbbreviation = objRecordSet("2_Letter_AB") strSQL = "SELECT Provinces."& strLanguage &"ProvinceAbbreviation AS FirstLanguageProvince From Provinces WHERE Provinces.ProvinceID = "& strCustomerProvince &"" set objRecordSet = Server.CreateObject("ADODB.RecordSet") objRecordSet.open strSQL, myConnection strProvinceAbbreviation = objRecordSet("FirstLanguageProvince") Call DisconnectFromDatabase() Dim dblTotalShippingCost, dblOverAllTotal, dblGstTax Dim intCustomerItemCount Dim strMailBody, Mail Dim strItemList Dim strThisCustomerEmail, strThisCustomerFullName dblOverAllTotal = 0 dblGstTax = 0 'Select all the items this customer has purchased strSQL = "SELECT SC_Customers.FirstName AS FName, SC_orders_items.ExtraInfo, SC_Customers.LastName AS LName, SC_Customers.Email AS CustEmail, SC_Items.EnglishItemName AS ItemName, SC_Customers.CustomerID FROM (SC_Customers INNER JOIN SC_Orders ON SC_Customers.CustomerID = SC_Orders.CustomerID) INNER JOIN (SC_Items INNER JOIN SC_orders_items ON SC_Items.ItemID = SC_orders_items.ItemID) ON SC_Orders.OrderID = SC_orders_items.OrderID WHERE (((SC_Customers.CustomerID)= " & strCustomerID & "))" Set objRecordSet = Server.CreateObject("ADODB.RecordSet") Set objRecordSet = GetRSFromDatabase(strSQL) 'Get customer information If Not(ObjRecordSet.EOF) Then strThisCustomerEmail = Trim(objRecordSet("CustEmail")) strThisCustomerFullName = Trim(objRecordSet("FName")) & " " & Trim(objRecordSet("LName")) End If intCustomerItemCount = objRecordSet.RecordCount If Cint(intCustomerItemCount) > 0 Then Redim arrItemName(intCustomerItemCount) For j=1 to intCustomerItemCount arrItemName(j) = objRecordSet("ItemName") if NOT (isNull(objRecordSet("ExtraInfo")) OR trim(objRecordSet("ExtraInfo")) = "") then arrItemName(j) = arrItemName(j) & " (" & objRecordSet("ExtraInfo") & ")" end if objRecordSet.MoveNext Next For j = 1 To intCustomerItemCount strItemList = arrItemName(j) & ", " & strItemList Next End If Call CreatePageTop(strRelativePath,"GenericValidation","Catalog","https://secure.internetsecure.com/process.cgi","POST","","Online Store") Dim strPopupMessage If strPopupMessage <> "" Then ' Pop-up any errors or messages %> <% End If If strPaymentOption = 1 Then ' Paid by credit card ' Only pass the province or state abbreviation once as a xxxProvince (hidden field) Dim strProvinceAbbreviation_IS If ((strProvinceAbbreviation <> "") AND (strProvinceAbbreviation <> "--")) Then strProvinceAbbreviation_IS = strProvinceAbbreviation Else strProvinceAbbreviation_IS = strStateAbbreviation End If %> <% ' Canadian shipping if (strCountryAbbreviation = "CA") then ' if intTotalNumOfItems > 10 Then ' dblTotalShippingCost = 12.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' dblTotalShippingCost = 8.50 ' else ' dblTotalShippingCost = 6.95 ' End If %> <% ' united state shipping elseif (strCountryAbbreviation = "US") then ' if intTotalNumOfItems => 7 Then ' dblTotalShippingCost = 16.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' dblTotalShippingCost = 12.95 ' else ' dblTotalShippingCost = 9.95 ' End If %> <% ' international shipping else ' if intTotalNumOfItems => 7 Then ' dblTotalShippingCost = 34.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' dblTotalShippingCost = 27.95 ' else ' dblTotalShippingCost = 19.95 ' End If %> <% end if %> "> ">


PERSONAL INFORMATION COMPLETE!

Thank you for completing your personal information. Please click CONTINUE PAYMENT to finalize your payment.

<% For i = 1 to intNumberOfItemsInCart dblOverAllTotal = dblOverAllTotal + ((arrShoppingCart(i,itemPrice)) * (arrShoppingCart(i,itemQuantity))) %> <% Next %> <% if (strCountryAbbreviation = "CA") then 'If the province are NB, NS or PEI than charge HST (15 percent) if strProvinceID = 4 or strProvinceID = 7 or strProvinceID = 9 or strProvinceID = 10 Then if strProvinceID = 9 Then strTaxlabel = "GST & PST" else strTaxlabel = "HST" end if dblGstTax = 0.13 else dblGstTax = 0.05 strTaxlabel = "GST" end if %> <% end if %>
QTY PRODUCT PRICE
<%= (arrShoppingCart(i,itemQuantity)) %> <%= (arrShoppingCart(i,itemName)) %> <%= FormatCurrency((arrShoppingCart(i,itemPrice)) * (arrShoppingCart(i,itemQuantity))) %>
SHIPPING & HANDLING <%= FormatCurrency(dblTotalShippingCost) %>
TAX (<%= strTaxlabel %>) <%= FormatCurrency((dblOverAllTotal) * dblGstTax) %>
TOTAL <%= FormatCurrency(((dblOverAllTotal) * dblGstTax) + (dblOverAllTotal) + dblTotalShippingCost )%>
<% 'EMPTY SHOPPING CART FOR FURTHER SHOPPING 'ReDim arrShoppingCart(MaxShoppingCartItems,NumOfHeadings) Session("public_ShoppingCart") = arrShoppingCart Session("public_NumberOfItemsInCart") = 0 %>

<% ElseIf strPaymentOption = 3 Then ' Payment with purchase order %> <% 'EMPTY SHOPPING CART FOR FURTHER SHOPPING 'ReDim arrShoppingCart(MaxShoppingCartItems,NumOfHeadings) Session("public_ShoppingCart") = arrShoppingCart Session("public_NumberOfItemsInCart") = 0 strMailBody = "Thank you for shopping at the Sound Venture Store. Your order for the following item(s): "& Left(Trim(strItemList), (len(Trim(strItemList)) - 1)) &" has been confirmed and is now being processed." &_ vbCrLf &_ vbCrLf &_ "We have issued and invoice against your purchase order number " & strPONumber & ". " &_ vbCrLf &_ vbCrLf &_ "Should you have any questions please contact us quoting your order number " & strUniqueID & "." strPopupMessage = SendASPMail(_ ClientSMTPServers,_ "Content Administrator",_ ClientReplyToEmailAddress,_ strThisCustomerFullName,_ strThisCustomerEmail,_ ClientEnglishWebsiteTitle,_ strMailBody ) If strPopupMessage <> "" Then popupmessage "There has been an error sending you a confirmation email please contact "& ClientContactEmailAddress &" for assistance." End If %>
Thank you for completing your personal information. Your order has been submitted into our database.

Please address your cheques and/or money orders to:

Sound Venture International Inc.
78 George St, Suite 204
Ottawa, Canada
K1N 5W1

Click here to return to the shopping area. <% ElseIf strPaymentOption = 2 Then ' Payment with cheque dblPriceTotal = FormatCurrency(dblPriceTotal) if (strCountryAbbreviation = "CA") then ' if intTotalNumOfItems > 10 Then ' dblTotalShippingCost = 12.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' dblTotalShippingCost = 8.50 ' else ' dblTotalShippingCost = 6.95 ' End If ' united state shipping elseif (strCountryAbbreviation = "US") then ' if intTotalNumOfItems => 7 Then ' dblTotalShippingCost = 16.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' dblTotalShippingCost = 12.95 ' else ' dblTotalShippingCost = 9.95 ' End If ' international shipping else ' if intTotalNumOfItems => 7 Then ' dblTotalShippingCost = 34.95 ' elseif intTotalNumOfItems => 4 and intTotalNumOfItems <= 6 Then ' dblTotalShippingCost = 27.95 ' else ' dblTotalShippingCost = 19.95 ' End If end if 'Email sent to customer strMailBody = "Thank you for shopping at the Sound Venture Online Store." &_ vbCrLf &_ vbCrLf &_ "Your order for the following item(s): "& Left(Trim(strItemList), (len(Trim(strItemList)) - 1)) &" has been confirmed and is now being processed." &_ vbCrLf &_ vbCrLf &_ "The items requested will be sent immediately upon receipt of your cheque or money order." &_ vbCrLf &_ vbCrLf &_ "Please make cheque/money order for " & dblPriceTotal & " payable to 'Sound Venture International Inc.'" &_ vbCrLf &_ "126 York Street, Suite 219" &_ vbCrLf &_ "Ottawa, Canada" &_ vbCrLf &_ "K1N 5T5" &_ vbCrLf &_ vbCrLf &_ "Should you have any questions please contact us at info@soundventure.com quoting your order number " & strUniqueID & "." strPopupMessage = SendASPMail(_ ClientSMTPServers,_ "Sound Venture Online Store",_ ClientReplyToEmailAddress,_ strThisCustomerFullName,_ strThisCustomerEmail,_ "Order Confirmation",_ strMailBody ) If strPopupMessage <> "" Then popupmessage "There has been an error sending you a confirmation email please contact "& ClientContactEmailAddress &" for assistance." End If 'Email sent to Vendor strMailBody = "An order has been placed at the Sound Venture Online Store." &_ vbCrLf &_ vbCrLf &_ "The order is for the following item(s): "& Left(Trim(strItemList), (len(Trim(strItemList)) - 1)) &" has been confirmed and now requires processing." &_ vbCrLf &_ vbCrLf &_ "The items requested will be sent immediately upon receipt of cheque or money order." &_ vbCrLf &_ vbCrLf &_ "Order Number: " & strUniqueID &_ vbCrLf &_ "Amount payable: " & dblPriceTotal &_ vbCrLf &_ vbCrLf &_ "For further details please access the administration area of the Sound Venture website." strPopupMessage = SendASPMail(_ ClientSMTPServers,_ "Sound Venture Online Store",_ ClientReplyToEmailAddress,_ strThisCustomerFullName,_ "info@soundventure.com",_ "Order Requested",_ strMailBody ) If strPopupMessage <> "" Then popupmessage "There has been an error sending you a confirmation email please contact "& ClientContactEmailAddress &" for assistance." End If 'End of email to Vendor %>



Thank you for completing your personal information.
Your order has been submitted into our database.

Please address your cheques and/or money orders to:

Sound Venture International Inc.
126 York Street, Suite 219
Ottawa, Canada
K1N 5T5

Please make reference to order # <%= strUniqueID%> on your cheque or money order.

<% For i = 1 to intNumberOfItemsInCart dblOverAllTotal = dblOverAllTotal + ((arrShoppingCart(i,itemPrice)) * (arrShoppingCart(i,itemQuantity))) %> <% Next %> <% if (strCountryAbbreviation = "CA") then 'If the province are NB, NS or PEI than charge HST (15 percent) and insert as gst if strProvinceID = 4 or strProvinceID = 7 or strProvinceID = 9 or strProvinceID = 10 Then if strProvinceID = 9 Then strTaxlabel = "GST & PST" else strTaxlabel = "HST" end if dblGstTax = 0.13 else dblGstTax = 0.05 strTaxlabel = "GST" end if %> <% end if %>
QTY PRODUCT PRICE
<%= (arrShoppingCart(i,itemQuantity)) %> <%= (arrShoppingCart(i,itemName)) %> <%= FormatCurrency((arrShoppingCart(i,itemPrice)) * (arrShoppingCart(i,itemQuantity))) %>
SHIPPING & HANDLING <%= FormatCurrency(dblTotalShippingCost) %>
TAX (<%= strTaxlabel %>) <%= FormatCurrency((dblOverAllTotal) * dblGstTax) %>
TOTAL <%= FormatCurrency(((dblOverAllTotal) * dblGstTax) + (dblOverAllTotal) + dblTotalShippingCost )%>

Click here to return to the shopping area.

<% 'EMPTY SHOPPING CART FOR FURTHER SHOPPING 'ReDim arrShoppingCart(MaxShoppingCartItems,NumOfHeadings) Session("public_ShoppingCart") = arrShoppingCart Session("public_NumberOfItemsInCart") = 0 %> <% End If %> <% Call CreatePageBottom(strRelativePath) 'Done processing valid shopping cart End If End Select %>