%option explicit%>
<%
'*********************************************************
' Display customer, shipping forms form is now in shopcustomerform.asp
' Version 6.50
'
' Nov 8, 2006 add email on registration HK
' Nov 11, 2006 HK don't allow gift certificates with other products
' Nov 28, 2006 HK Add Free products based on order amounts
'*********************************************************
Dim strPassword1, strPassword2, ShipMethodType
Dim msg, newcust, Restorefromcookie
Dim i, sAction, Oid, dbc, scartitem, arrCart, Length
dim cookielogin, straffid, straffid1
Dim sbreadcrumb, spagename
'VP-ASP 6.50 - welcome email
dim previouscustomerid
dim My_system
'VP-ASP 6.50 - buy certain amount, get product free
dim Nameincart
' Main Logic
SetupCustomer
setsess "form", ""
If request("new")="yes" then
ResetCustomerSessionData
Setsess "customerlogincid",""
SetSess "Login",""
setsess "lastname",""
cookielogin="No"
setsess "form", "1"
sbreadcrumb = getlang("langmaillistsubject")
spagename = getlang("langmaillistsubject")
elseif request("new")="no" then
ResetCustomerSessionData
Setsess "customerlogincid",""
SetSess "Login",""
setsess "lastname",""
cookielogin="No"
setsess "form", ""
sbreadcrumb = getlang("langcommonlogin")
spagename = getlang("langformatcustomerinformation")
else
If getsess("Login") = "" Then
sbreadcrumb = getlang("langcommonlogin")
Else
sbreadcrumb = getlang("langformatcustomerinformation")
spagename = getlang("langformatcustomerinformation")
End If
end if
'
sAction=Request.form("Action") ' find out if we are being called via submit
if saction="" then
sAction=Request.form("Action.x")
end if
Serror=GetSess("Loginerror") ' possible mesage from login
SetSess "Loginerror","" ' error from shop login
If sAction = "" Then ' no came from customer logic
If cookielogin<>"No" then
Getcustomercookie
end if
Cookielogin=""
GetGiftRegSessionData
GetCustomerSessionData '
DisplayEverything '
Else
sError=""
ValidateData() ' need to validate anything, nothing is required
If checkForExistingCustomer(strLastName, strEmail, strPassword1) then
sError = sError & getlang("langCustomerExists") & "
"
end if
if sError = "" Then
UpdateOrderInformation ' put in customer and order data
SetSess "Login",strlastname
'VP-ASP 6.50 - when customer registers, they should be logged in as well
if getconfig("xcustomerrequiresauthorization") <> "Yes" then
setsess "customername", strfirstname
GetCustomerSessionData
dim tempshipmethodtype
tempshipmethodtype = GetSess("Shipmethodtype")
UpdateCustomerSessionData
setsess "Shipmethodtype", tempshipmethodtype
end if
responseredirect GetSess("FollowonURL")
else
UpdateCustomerSessionData
DisplayEverything
end if
end if
' End of main logic
Sub DisplayEveryThing
ShopPageHeader ' Normal page header
if getconfig("xbreadcrumbs") = "Yes" then
response.write "