📄 powereasy.orderflow.asp
字号:
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Dim Phone, InvoiceContent, Remark, InvoiceInfo, BeginDate
Dim ProductList, ProductID
Dim PresentList, PresentID
Dim ShowTips_Login, ShowTips_CartIsEmpty
Dim rsCart, CartID, IsWholesale
Dim dblPrice, dblTruePrice, dblTempPrice, dblAmount, dblSubtotal, dblTotal, dblTotal2
Dim strProductType, strSaleType, strDiscount
Dim TotalExp, TotalMoney, TotalPoint
Dim strJS
Dim PaymentType, PaymentTypeName, Discount_Payment, rsPaymentType
Dim DeliverType, DeliverTypeName, Charge_Deliver, rsDeliverType
Dim ReleaseType, MinMoney1, ReleaseCharge, MinMoney2, MaxCharge, MinMoney3
Dim Charge_Min, Weight_Min, ChargePerUnit, WeightPerUnit, Charge_Max
Dim Charge_Percent
Dim TotalWeight
Dim Present2, Present3, Present4, Cash
Dim NeedInvoice
Dim ContacterName, Company, Department, OfficePhone, HomePhone, Fax, Mobile, Address, ZipCode, AgentName
ChannelShortName = "产品"
MaxPerPage = 20
HitsOfHot = 1000
XmlDoc.Load (Server.MapPath(InstallDir & "Language/Gb2312.xml"))
UserLogined = CheckUserLogined()
If UserLogined = False Then
ShowTips_Login = "<tr><td colspan='10'>" & XmlText_Class("ShowTips_Login", "<font color='#0000FF'>温馨提示:</font><font color='#006600'>您还没有注册或登录,请先<a href='../Reg/User_Reg.asp'>注册</a>或<a href='../User/User_Login.asp'>登录</a>,以获得更多优惠!</font>") & "</td></tr>"
Else
Call GetUser(UserName)
ShowTips_Login = ""
End If
strPageTitle = SiteTitle
Call GetChannel(ChannelID)
If Trim(ChannelName) <> "" And ShowChannelName <> False Then
If UseCreateHTML > 0 Then
strNavPath = strNavPath & " >> <a href='" & ChannelUrl & "/Index" & FileExt_Index & "'>" & ChannelName & "</a>"
Else
strNavPath = strNavPath & " >> <a href='" & ChannelUrl & "/Index.asp'>" & ChannelName & "</a>"
End If
strPageTitle = strPageTitle & " >> " & ChannelName
End If
Sub ReplaceCommon()
Call ReplaceCommonLabel
strHtml = Replace(strHtml, "{$PageTitle}", strPageTitle)
strHtml = Replace(strHtml, "{$ShowPath}", strNavPath)
strHtml = PE_Replace(strHtml, "{$MenuJS}", GetMenuJS(ChannelDir, ShowClassTreeGuide))
strHtml = PE_Replace(strHtml, "{$Skin_CSS}", GetSkin_CSS(0))
End Sub
Sub ReplaceUserInfo()
strHtml = PE_Replace(strHtml, "{$UserName}", UserName & "")
strHtml = PE_Replace(strHtml, "{$GroupName}", GroupName & "")
strHtml = PE_Replace(strHtml, "{$Discount_Member}", Discount_Member & "")
strHtml = PE_Replace(strHtml, "{$IsOffer}", IsOffer & "")
strHtml = PE_Replace(strHtml, "{$Balance}", Balance & "")
strHtml = PE_Replace(strHtml, "{$UserPoint}", UserPoint & "")
strHtml = PE_Replace(strHtml, "{$UserExp}", UserExp & "")
strHtml = PE_Replace(strHtml, "{$Email}", Email & "")
End Sub
Function ShowCart()
If IsNull(ProductList) Or ProductList = "" Then
ShowCart = ""
Exit Function
End If
If IsValidID(ProductList) = False Then
ShowCart = "<li>ProductList数据非法!</li>"
Exit Function
End If
Dim strCart
strCart = strCart & " <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border3'>" & vbCrLf
strCart = strCart & " <tr align='center' class='tdbg2' height='25'>" & vbCrLf
strCart = strCart & " <td width='32'><b>购买</b></td>" & vbCrLf
strCart = strCart & " <td><b>商 品 名 称</b></td>" & vbCrLf
strCart = strCart & " <td width='44'><b>单 位</b></td>" & vbCrLf
strCart = strCart & " <td width='54'><b>数 量</b></td>" & vbCrLf
strCart = strCart & " <td width='64'><b>商品类别</b></td>" & vbCrLf
strCart = strCart & " <td width='64'><b>销售类型</b></td>" & vbCrLf
strCart = strCart & " <td width='64'><b>原价</b></td>" & vbCrLf
strCart = strCart & " <td width='44'><b>折扣</b></td>" & vbCrLf
strCart = strCart & " <td width='64'><b>实价</b></td>" & vbCrLf
strCart = strCart & " <td width='84'><b>金 额</b></td>" & vbCrLf
strCart = strCart & " </tr>" & vbCrLf
dblSubtotal = 0
dblTotal = 0
TotalExp = 0
TotalMoney = 0
TotalPoint = 0
Set rsCart = Conn.Execute("select P.*,C.Quantity,C.CartItemID from PE_Product P inner join PE_ShoppingCarts C on C.ProductID=P.ProductID where C.CartID='" & CartID & "' and C.PresentID=0 and P.ProductType<>4 order by C.CartItemID desc")
Do While Not rsCart.EOF
dblAmount = rsCart("Quantity")
If dblAmount <= 0 Then dblAmount = 1
If rsCart("ProductType") = 3 And rsCart("LimitNum") > 0 And dblAmount > rsCart("LimitNum") Then
strJS = strJS & "你订购了" & dblAmount & rsCart("Unit") & rsCart("ProductName") & ",而此商品每人最多限购" & rsCart("LimitNum") & rsCart("Unit") & ",所以系统已自动将您的订购数量更改为" & rsCart("LimitNum") & rsCart("Unit") & "!\n"
dblAmount = rsCart("LimitNum")
End If
If rsCart("Stocks") - rsCart("OrderNum") < dblAmount Then
strJS = strJS & "你订购了" & dblAmount & rsCart("Unit") & rsCart("ProductName") & ",而此商品目前只有" & rsCart("Stocks") - rsCart("OrderNum") & rsCart("Unit") & "库存!\n您可以修改订购数或者继续按原数量订购,我们将尽快配齐此商品。\n"
End If
If dblAmount <> rsCart("Quantity") Then
Call UpdateAmount(rsCart("CartItemID"), dblAmount)
End If
dblPrice = rsCart("Price_Original")
If PE_CLng(UserSetting(30)) = 1 And rsCart("EnableWholesale") = True And dblAmount >= rsCart("Number_Wholesale1") Then
strProductType = "批发"
strSaleType = "批发"
strDiscount = "─"
If dblAmount < rsCart("Number_Wholesale2") Then
dblTruePrice = rsCart("Price_Wholesale1")
Else
If dblAmount < rsCart("Number_Wholesale3") Then
dblTruePrice = rsCart("Price_Wholesale2")
Else
dblTruePrice = rsCart("Price_Wholesale3")
End If
End If
Else
Select Case GroupType
Case 0, 1 '未登录
Select Case rsCart("ProductType")
Case 1
dblTruePrice = rsCart("Price")
strProductType = "正常销售"
strDiscount = "─"
Case 2
strProductType = "涨价商品"
dblTruePrice = rsCart("Price")
strDiscount = "─"
Case 3
If Date < rsCart("BeginDate") Or Date > rsCart("EndDate") Then
dblTruePrice = dblPrice
strProductType = "正常销售"
strDiscount = "─"
Else
dblTruePrice = rsCart("Price")
strProductType = "特价商品"
strDiscount = rsCart("Discount") & "折"
End If
Case 5
strProductType = "降价商品"
dblTruePrice = rsCart("Price")
strDiscount = rsCart("Discount") & "折"
End Select
Case 2, 3 '注册会员
Select Case rsCart("ProductType")
Case 1
strProductType = "正常销售"
strDiscount = "─"
If rsCart("Price_Member") > 0 Then '如果指定了会员价
dblTruePrice = rsCart("Price_Member")
Else
dblTruePrice = rsCart("Price") * Discount_Member / 100
End If
Case 2
strProductType = "涨价商品"
strDiscount = "─"
If rsCart("Price_Member") > 0 Then '如果指定了会员价
dblTruePrice = rsCart("Price_Member")
Else
dblTruePrice = rsCart("Price") * Discount_Member / 100
End If
Case 3, 5
If rsCart("ProductType") = 3 Then
If Date < rsCart("BeginDate") Or Date > rsCart("EndDate") Then
strProductType = "正常销售"
strDiscount = "─"
dblTempPrice = dblPrice
Else
strProductType = "特价商品"
strDiscount = rsCart("Discount") & "折"
dblTempPrice = rsCart("Price")
End If
Else
strProductType = "降价商品"
strDiscount = rsCart("Discount") & "折"
dblTempPrice = rsCart("Price")
End If
If rsCart("Price_Member") > 0 Then '如果指定了会员价
If rsCart("Price_Member") <= dblTempPrice Then
dblTruePrice = rsCart("Price_Member")
Else
dblTruePrice = dblTempPrice
End If
Else
If PE_CLng(UserSetting(12)) = 1 Then '如可以享受折上折优惠
dblTruePrice = dblTempPrice * Discount_Member / 100
Else
If dblPrice * Discount_Member / 100 >= dblTempPrice Then
dblTruePrice = dblTempPrice
Else
dblTruePrice = dblPrice * Discount_Member / 100
End If
End If
End If
End Select
Case 4 '代理商
Select Case rsCart("ProductType")
Case 1
strProductType = "正常销售"
strDiscount = "─"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -