<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Modify Store General Settings ' Product : CandyPress Store Frontend ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 0 %> <% 'Config Variables dim urlNonSSL,urlSSL,pDownloadDir,pImagesDir,mailComp dim pSMTPServer,pEmailSales,pEmailAdmin,pCompany,pCatalogOnly dim pMaxCartQty,prodViewLayout,pHidePricingZero,pMaxItemQty dim pMinCartAmount,pMaxItemsPerPage,pOrderPrefix,pCurrencySign dim pStoreLCID,pShowStockView,pMailIn,pPayPal,payPalMemberID dim pCreditCard,pCCType,pAuthNet,authNetLogin,authNetCurrCode dim payMsgMailIn,payMsgCreditCard,payMsgPayPal,payMsgOther dim payMsgNotReq,shipDisplayType,TwoCheckOut,TwoCheckOutSID dim payMsgTwoCheckOut,pEmailFriendSec,pMaxDownloadHours dim pMaxDownloadCount,payDefault,pAuthNetFrontEnd,payMsgAuthNet dim pCompanyAddr,TwoCheckoutMD5,pHideAddStockLevel,payCustom dim payMsgCustom,taxOnShipping,allowShipAddr,defaultCountryCode dim listViewLayout,payCallIn,payFaxIn,PayCOD,statUpdPending dim payMsgCallIn,payMsgFaxIn,payMsgCOD,taxBillOrShip dim handlingFeeAmt,handlingFeeTax,payPalCurrCode,authNetTxKey dim homeViewLayout,pEmailStockLevel,pAuthNetType,pHTMLarea dim pProdThumbs,homeViewRandom,timeOffSet,feeMailIn,feeCallIn dim feeFaxIn,feeCOD,feeOffCC,feePayPal,fee2CO,feeAuthNet,feeCustom dim categoryLayout,MSXMLprogID,XMLDOMprogID,hideAddOnProdList dim useSecureDownload 'Database variables dim mySQL, cn, rs '************************************************************************* 'Open Database call openDb() 'Get current configuration settings from database mySQL = "SELECT configVar, configVal " _ & "FROM storeAdmin " _ & "WHERE adminType = 'C'" set rs = openRSexecute(mySQL) do while not rs.EOF select case trim(lCase(rs("configVar"))) case lCase("urlNonSSL") urlNonSSL = rs("configVal") case lCase("urlSSL") urlSSL = rs("configVal") case lCase("pDownloadDir") pDownloadDir = rs("configVal") case lCase("pImagesDir") pImagesDir = rs("configVal") case lCase("mailComp") mailComp = rs("configVal") case lCase("pSMTPServer") pSMTPServer = rs("configVal") case lCase("pEmailSales") pEmailSales = rs("configVal") case lCase("pEmailAdmin") pEmailAdmin = rs("configVal") case lCase("pCompany") pCompany = rs("configVal") case lCase("pCatalogOnly") pCatalogOnly = rs("configVal") case lCase("pHidePricingZero") pHidePricingZero = rs("configVal") case lCase("pMaxCartQty") pMaxCartQty = rs("configVal") case lCase("pMaxItemQty") pMaxItemQty = rs("configVal") case lCase("pMinCartAmount") pMinCartAmount = rs("configVal") case lCase("pMaxItemsPerPage") pMaxItemsPerPage = rs("configVal") case lCase("pOrderPrefix") pOrderPrefix = rs("configVal") case lCase("pCurrencySign") pCurrencySign = rs("configVal") case lCase("pStoreLCID") pStoreLCID = rs("configVal") case lCase("pShowStockView") pShowStockView = rs("configVal") case lCase("pMailIn") pMailIn = rs("configVal") case lCase("pPayPal") pPayPal = rs("configVal") case lCase("payPalMemberID") payPalMemberID = rs("configVal") case lCase("TwoCheckOut") TwoCheckOut = rs("configVal") case lCase("TwoCheckOutSID") TwoCheckOutSID = rs("configVal") case lCase("pCreditCard") pCreditCard = rs("configVal") case lCase("pCCType") pCCType = rs("configVal") case lCase("pAuthNet") pAuthNet = rs("configVal") case lCase("authNetLogin") authNetLogin = rs("configVal") case lCase("authNetCurrCode") authNetCurrCode = rs("configVal") case lCase("payMsgMailIn") payMsgMailIn = rs("configVal") case lCase("payMsgCreditCard") payMsgCreditCard = rs("configVal") case lCase("payMsgPayPal") payMsgPayPal = rs("configVal") case lCase("payMsgTwoCheckOut") payMsgTwoCheckOut = rs("configVal") case lCase("payMsgOther") payMsgOther = rs("configVal") case lCase("payMsgNotReq") payMsgNotReq = rs("configVal") case lCase("pEmailFriendSec") pEmailFriendSec = rs("configVal") case lCase("pMaxDownloadHours") pMaxDownloadHours = rs("configVal") case lCase("pMaxDownloadCount") pMaxDownloadCount = rs("configVal") case lCase("payDefault") payDefault = rs("configVal") case lCase("pAuthNetFrontEnd") pAuthNetFrontEnd = rs("configVal") case lCase("pCompanyAddr") pCompanyAddr = rs("configVal") case lCase("payMsgAuthNet") payMsgAuthNet = rs("configVal") case lCase("TwoCheckoutMD5") TwoCheckoutMD5 = rs("configVal") case lCase("pHideAddStockLevel") pHideAddStockLevel = rs("configVal") case lCase("payCustom") payCustom = rs("configVal") case lCase("payMsgCustom") payMsgCustom = rs("configVal") case lCase("taxOnShipping") taxOnShipping = rs("configVal") case lCase("allowShipAddr") allowShipAddr = rs("configVal") case lCase("prodViewLayout") prodViewLayout = rs("configVal") case lCase("shipDisplayType") shipDisplayType = rs("configVal") case lCase("defaultCountryCode") defaultCountryCode = rs("configVal") case lCase("payCallIn") payCallIn = rs("configVal") case lCase("payFaxIn") payFaxIn = rs("configVal") case lCase("payCOD") payCOD = rs("configVal") case lCase("payMsgCallIn") payMsgCallIn = rs("configVal") case lCase("payMsgFaxIn") payMsgFaxIn = rs("configVal") case lCase("payMsgCOD") payMsgCOD = rs("configVal") case lCase("listViewLayout") listViewLayout = rs("configVal") case lCase("taxBillOrShip") taxBillOrShip = rs("configVal") case lCase("statUpdPending") statUpdPending = rs("configVal") case lCase("handlingFeeAmt") handlingFeeAmt = rs("configVal") case lCase("handlingFeeTax") handlingFeeTax = rs("configVal") case lCase("payPalCurrCode") payPalCurrCode = rs("configVal") case lCase("authNetTxKey") authNetTxKey = rs("configVal") case lCase("homeViewLayout") homeViewLayout = rs("configVal") case lCase("pEmailStockLevel") pEmailStockLevel = rs("configVal") case lCase("pAuthNetType") pAuthNetType = rs("configVal") case lCase("pHTMLarea") pHTMLarea = rs("configVal") case lCase("pProdThumbs") pProdThumbs = rs("configVal") case lCase("homeViewRandom") homeViewRandom = rs("configVal") case lCase("timeOffSet") timeOffSet = rs("configVal") case lCase("feeMailIn") feeMailIn = rs("configVal") case lCase("feeCallIn") feeCallIn = rs("configVal") case lCase("feeFaxIn") feeFaxIn = rs("configVal") case lCase("feeCOD") feeCOD = rs("configVal") case lCase("feeOffCC") feeOffCC = rs("configVal") case lCase("feePayPal") feePayPal = rs("configVal") case lCase("fee2CO") fee2CO = rs("configVal") case lCase("feeAuthNet") feeAuthNet = rs("configVal") case lCase("feeCustom") feeCustom = rs("configVal") case lCase("categoryLayout") categoryLayout = rs("configVal") case lCase("MSXMLprogID") MSXMLprogID = rs("configVal") case lCase("XMLDOMprogID") XMLDOMprogID = rs("configVal") case lCase("hideAddOnProdList") hideAddOnProdList = rs("configVal") case lCase("useSecureDownload") useSecureDownload = rs("configVal") end select rs.MoveNext loop call closeRS(rs) 'Close Database call closedb() 'If the config file (or some of the fields in it) is empty (as would 'be the case for users who created their own database), then 'pre-populate some fields with default values. if isNull(urlNonSSL) or isEmpty(urlNonSSL) then urlNonSSL = "http://localhost/CandyPress/Scripts/" end if if isNull(urlSSL) or isEmpty(urlSSL) then urlSSL = "https://localhost/CandyPress/Scripts/" end if if isNull(pDownloadDir) or isEmpty(pDownloadDir) then pDownloadDir = "../Downloads/" end if if isNull(pImagesDir) or isEmpty(pImagesDir) then pImagesDir = "../ProdImages/" end if if isNull(pMaxCartQty) or isEmpty(pMaxCartQty) then pMaxCartQty = 30 end if if isNull(pMaxItemQty) or isEmpty(pMaxItemQty) then pMaxItemQty = 20 end if if isNull(pMinCartAmount) or isEmpty(pMinCartAmount) then pMinCartAmount = 0 end if if isNull(pMaxItemsPerPage) or isEmpty(pMaxItemsPerPage) then pMaxItemsPerPage = 5 end if if isNull(pOrderPrefix) or isEmpty(pOrderPrefix) then pOrderPrefix = "CP" end if if isNull(pCurrencySign) or isEmpty(pCurrencySign) then pCurrencySign = "$" end if if isNull(pStoreLCID) or isEmpty(pStoreLCID) then pStoreLCID = "1033" end if if isNull(pMaxDownloadHours) or isEmpty(pMaxDownloadHours) then pMaxDownloadHours = 0 end if if isNull(pMaxDownloadCount) or isEmpty(pMaxDownloadCount) then pMaxDownloadCount = 0 end if if isNull(pHideAddStockLevel) or isEmpty(pHideAddStockLevel) then pHideAddStockLevel = -1 end if if isNull(pEmailStockLevel) or isEmpty(pEmailStockLevel) then pEmailStockLevel = -1 end if if isNull(handlingFeeAmt) or isEmpty(handlingFeeAmt) then handlingFeeAmt = 0 end if if isNull(payMsgMailIn) or isEmpty(payMsgMailIn) then payMsgMailIn = "Mail-In" end if if isNull(payMsgCallIn) or isEmpty(payMsgCallIn) then payMsgCallIn = "Call-In" end if if isNull(payMsgFaxIn) or isEmpty(payMsgFaxIn) then payMsgFaxIn = "Fax-In" end if if isNull(payMsgCOD) or isEmpty(payMsgCOD) then payMsgCOD = "COD" end if if isNull(payMsgCreditCard) or isEmpty(payMsgCreditCard) then payMsgCreditCard = "CreditCard" end if if isNull(payMsgPayPal) or isEmpty(payMsgPayPal) then payMsgPayPal = "PayPal" end if if isNull(payMsgTwoCheckOut) or isEmpty(payMsgTwoCheckOut) then payMsgTwoCheckOut = "2CheckOut" end if if isNull(payMsgAuthNet) or isEmpty(payMsgAuthNet) then payMsgAuthNet = "Authorize.Net" end if if isNull(payMsgCustom) or isEmpty(payMsgCustom) then payMsgCustom = "Custom Payment" end if if isNull(payMsgOther) or isEmpty(payMsgOther) then payMsgOther = "Undetermined" end if if isNull(payMsgNotReq) or isEmpty(payMsgNotReq) then payMsgNotReq = "Payment Not Required" end if if isNull(homeViewRandom) or isEmpty(homeViewRandom) then homeViewRandom = -1 end if if isNull(timeOffSet) or isEmpty(timeOffSet) then timeOffSet = 0 end if if isNull(feeMailIn) or isEmpty(feeMailIn) then feeMailIn = 0 end if if isNull(feeCallIn) or isEmpty(feeCallIn) then feeCallIn = 0 end if if isNull(feeFaxIn) or isEmpty(feeFaxIn) then feeFaxIn = 0 end if if isNull(feeCOD) or isEmpty(feeCOD) then feeCOD = 0 end if if isNull(feeOffCC) or isEmpty(feeOffCC) then feeOffCC = 0 end if if isNull(feePayPal) or isEmpty(feePayPal) then feePayPal = 0 end if if isNull(fee2CO) or isEmpty(fee2CO) then fee2CO = 0 end if if isNull(feeAuthNet) or isEmpty(feeAuthNet) then feeAuthNet = 0 end if if isNull(feeCustom) or isEmpty(feeCustom) then feeCustom = 0 end if if isNull(MSXMLprogID) or isEmpty(MSXMLprogID) then MSXMLprogID = "MSXML2.ServerXMLHTTP" end if if isNull(XMLDOMprogID) or isEmpty(XMLDOMprogID) then XMLDOMprogID = "Microsoft.XMLDOM" end if %>

Store Configuration

URL's and Folders
<%call dispTextConfig("Full NON-SSL URL to ""Scripts"" folder (Test)",30,250,"urlNonSSL",urlNonSSL)%> <%call dispTextConfig("Full SSL URL to ""Scripts"" folder (Test)",30,250,"urlSSL",urlSSL)%> <%call dispTextConfig("Download folder (relative to /Scripts folder)",30,250,"pDownloadDir",pDownloadDir)%> <%call dispTextConfig("Images folder (relative to /Scripts folder)",30,250,"pImagesDir",pImagesDir)%>

Email
<%call dispTextConfig("Mail server's address",30,100,"pSMTPServer",pSMTPServer)%> <%call dispTextConfig("Email address of Sales Department",30,100,"pEmailSales",pEmailSales)%> <%call dispTextConfig("Email address of Webmaster or Technical contact",30,100,"pEmailAdmin",pEmailAdmin)%>
Mail component you will be using

MS XML Components
<%call dispTextConfig("MSXML HTTP Program ID",30,100,"MSXMLprogID",MSXMLprogID)%> <%call dispTextConfig("MSXML DOM Program ID",30,100,"XMLDOMprogID",XMLDOMprogID)%>

Company Info
<%call dispTextConfig("Company Name",30,100,"pCompany",pCompany)%>
Company Address info (max 250 chars)

General Settings
<%call dispYNConfig("Operate store in Catalog Only mode?","pCatalogOnly",pCatalogOnly)%> <%call dispYNConfig(" - Show extended view of related products?","pProdThumbs",pProdThumbs)%> <%call dispYNConfig(" - Always hide Add button on product list page?","hideAddOnProdList",hideAddOnProdList)%> <%call dispTextConfig(" - Number of products per page on product list page",10,10,"pMaxItemsPerPage",pMaxItemsPerPage)%> <%call dispTextConfig(" - Number of random products on home page (-1 disables)",10,10,"homeViewRandom",homeViewRandom)%> <%call dispYNConfig("Hide pricing if Product Price is 0.00?","pHidePricingZero",pHidePricingZero)%> <%call dispYNConfig("Prevent modification of ""Email To Friend"" message body?","pEmailFriendSec",pEmailFriendSec)%> <%call dispTextConfig("Maximum quantity allowed for the entire order",10,10,"pMaxCartQty",pMaxCartQty)%> <%call dispTextConfig("Maximum quantity allowed per item",10,10,"pMaxItemQty",pMaxItemQty)%> <%call dispTextConfig("Minimum purchase amount before checkout",10,10,"pMinCartAmount",pMinCartAmount)%> <%call dispTextConfig("Order Number prefix",10,10,"pOrderPrefix",pOrderPrefix)%> <%call dispTextConfig("Currency sign for your store",10,10,"pCurrencySign",pCurrencySign)%> <%call dispTextConfig("Locale Identifier used to format dates & numbers",10,10,"pStoreLCID",pStoreLCID)%> <%call dispTextConfig("Time offset in hours (-12 to 12, 0=none)",3,3,"timeOffSet",timeOffSet)%> <%call dispTextConfig("Default Country Code (leave empty for none)",2,2,"defaultCountryCode",defaultCountryCode)%> <%call dispYNConfig("Use streaming downloads?","useSecureDownload",useSecureDownload)%> <%call dispTextConfig("Max hours allowed to download software (0=unlimited)",10,10,"pMaxDownloadHours",pMaxDownloadHours)%> <%call dispTextConfig("Max times allowed to download software (0=unlimited)",10,10,"pMaxDownloadCount",pMaxDownloadCount)%> <%call dispYNConfig("Use WYSIWIG HTMLarea editor in the Admin?","pHTMLarea",pHTMLarea)%>
Select product details layout
Select product list layout
Select home page layout
Select category list layout
Calculate taxes based on Billing or Shipping location?

Stock
<%call dispYNConfig("Show stock level messages?","pShowStockView",pShowStockView)%> <%call dispYNConfig("Update stock if order status is Pending?","statUpdPending",statUpdPending)%> <%call dispTextConfig("Out of stock level (-1 disables)",10,10,"pHideAddStockLevel",pHideAddStockLevel)%> <%call dispTextConfig("Low stock Email warning level (-1 disables)",10,10,"pEmailStockLevel",pEmailStockLevel)%>

Shipping
<%call dispYNConfig("Allow customer to enter a separate shipping address?","allowShipAddr",allowShipAddr)%> <%call dispYNConfig("Include shipping total when calculating taxes?","taxOnShipping",taxOnShipping)%> <%call dispTextConfig("Handling fee amount (0 for none)",10,10,"handlingFeeAmt",handlingFeeAmt)%> <%call dispYNConfig("Include handling fee when calculating taxes?","handlingFeeTax",handlingFeeTax)%>
Select shipping rates display format

Offline Payments
<%call dispYNConfig("Allow payments to be Mailed in?","pMailIn",pMailIn)%> <%call dispTextConfig("Mail In payments description",30,50,"payMsgMailIn",payMsgMailIn)%> <%call dispTextConfig("Mail In payments fee",10,10,"feeMailIn",feeMailIn)%> <%call dispYNConfig("Allow payments to be Called in?","payCallIn",payCallIn)%> <%call dispTextConfig("Call In payments description",30,50,"payMsgCallIn",payMsgCallIn)%> <%call dispTextConfig("Call In payments fee",10,10,"feeCallIn",feeCallIn)%> <%call dispYNConfig("Allow payments to be Faxed in?","payFaxIn",payFaxIn)%> <%call dispTextConfig("Fax In payments description",30,50,"payMsgFaxIn",payMsgFaxIn)%> <%call dispTextConfig("Fax In payments fee",10,10,"feeFaxIn",feeFaxIn)%> <%call dispYNConfig("Allow COD payments?","payCOD",payCOD)%> <%call dispTextConfig("COD payments description",30,50,"payMsgCOD",payMsgCOD)%> <%call dispTextConfig("COD payments fee",10,10,"feeCOD",feeCOD)%> <%call dispYNConfig("Allow Offline Credit Card payments?","pCreditCard",pCreditCard)%> <%call dispTextConfig("Credit Card payments description",30,50,"payMsgCreditCard",payMsgCreditCard)%> <%call dispTextConfig("List of accepted credit cards (seperated by commas)",30,250,"pCCType",pCCType)%> <%call dispTextConfig("Credit Card payments fee",10,10,"feeOffCC",feeOffCC)%>
1. Mail In Payments :    
2. Call In Payments :    
3. Fax In Payments :    
4. COD Payments :    
5. Offline Credit Card Payments :    

PayPal Payments
<%call dispYNConfig("Allow payments via PayPal?","pPayPal",pPayPal)%> <%call dispTextConfig("PayPal payments description",30,50,"payMsgPayPal",payMsgPayPal)%> <%call dispTextConfig("Your PayPal member ID",30,100,"payPalMemberID",payPalMemberID)%> <%call dispTextConfig("PayPal payments fee",10,10,"feePayPal",feePayPal)%>
Currency to use for PayPal (Subject to availability)

2CheckOut Payments
<%call dispYNConfig("Allow payments via 2CheckOut?","TwoCheckOut",TwoCheckOut)%> <%call dispTextConfig("2CheckOut payments description",30,50,"payMsgTwoCheckOut",payMsgTwoCheckOut)%> <%call dispTextConfig("Your 2CheckOut Account Number",30,100,"TwoCheckOutSID",TwoCheckOutSID)%> <%call dispTextConfig("Your 2CheckOut MD5 Secret Word",30,100,"TwoCheckOutMD5",TwoCheckOutMD5)%> <%call dispTextConfig("2CheckOut payments fee",10,10,"fee2CO",fee2CO)%>

Authorize.Net Payments
<%call dispYNConfig("Allow payments via Authorize.Net?","pAuthNetFrontEnd",pAuthNetFrontEnd)%> <%call dispTextConfig("Authorize.Net payments description",30,50,"payMsgAuthNet",payMsgAuthNet)%> <%call dispTextConfig("Authorize.Net Login ID",30,100,"authNetLogin",authNetLogin)%> <%call dispTextConfig("Authorize.Net Transaction Key",30,100,"authNetTxKey",authNetTxKey)%> <%call dispTextConfig("Authorize.Net Currency Code for your store",5,10,"authNetCurrCode",authNetCurrCode)%> <%call dispYNConfig("Use Authorize.Net SIM to process payments via Admin?","pAuthNet",pAuthNet)%> <%call dispTextConfig("Authorize.Net payments fee",10,10,"feeAuthNet",feeAuthNet)%>
Authorize.Net connection method

Custom Payments
<%call dispYNConfig("Use custom payment routine?","payCustom",payCustom)%> <%call dispTextConfig("Custom payments description",30,50,"payMsgCustom",payMsgCustom)%> <%call dispTextConfig("Custom payments fee",10,10,"feeCustom",feeCustom)%>

Miscellaneous Payment Info
<%call dispTextConfig("Other/Unknown payments description",30,50,"payMsgOther",payMsgOther)%> <%call dispTextConfig("Description to be used if payment is NOT required",30,50,"payMsgNotReq",payMsgNotReq)%>
Default Payment Type

<% '********************************************************************** 'Display Text Configuration Settings '********************************************************************** sub dispTextConfig(Description,Size,MaxLength,Name,Value) %> <%=Description%> <% end sub '********************************************************************** 'Display Y/N Configuration Settings '********************************************************************** sub dispYNConfig(Description,Name,Value) %> <%=Description%> <% end sub %>