<% ' Copyright (C) 1998-2005 CyberStrong Internet Services, Inc. All Rights Reserved ' ' This file has been seeded with unique information at point of sale and ' is traceable to its purchaser. ' ' Your license agreement forbids the removal of this notice. ' sQty.asp - Vendor By Order Value Lookup Class clsShippingRateByOrderQty ' Constructor ----------------------------------------------------- Private Sub Class_Initialize() Name = "By Quantity Shipping" Installed = True Trace = False HelpFileName = "hByQty.asp" Version = 1.0 PreviewFields = "" End Sub ' Destructor ------------------------------------------------------ Private Sub Class_Terminate() End Sub ' Public Properties ----------------------------------------------- Public Name ' The full name of this gateway Public Installed ' True for real gateway, False for gateway hook Public Trace ' True to enable debug messages Public HelpFileName ' Help for this gateway stored here Public Version ' Class version number Public PreviewFields ' Comma separated list of fields required for shipping preview ' Public Methods -------------------------------------------------- ' AddRates() - Add rates for this shipping method to master rate table ... Public Sub AddRates(ByVal argShipToInfo, ByVal argCart, ByRef argShipChoiceTable, ByRef argErrorMsg) Dim SQL, Key, rsMethods, rsCost On Error Resume Next SQL = "SELECT * FROM ShippingByQtyRates " & _ "WHERE (" & argShipToInfo.OrderQtyCount & " >= ByQtyMinItemCount) AND " & _ "(" & argShipToInfo.OrderQtyCount & " <= ByQtyMaxItemCount)" Set rsCost = Server.CreateObject("ADODB.Recordset") rsCost.Open SQL, Conn, adOpenKeyset, adLockOptimistic If (rsCost.RecordCount <> 0) Then SQL = "SELECT * FROM ShippingMethods " & _ "WHERE {fn LCase(Gateway)} = 'byqty' AND {fn LCase(ShippingMethodActive)} = 'yes'" Set rsMethods = Server.CreateObject("ADODB.Recordset") rsMethods.Open SQL, Conn, adOpenKeyset, adLockOptimistic ' Save rate(s) in table for customer selection ... Do While (Not rsMethods.EOF) Key = Trim(rsMethods("ShippingMethod")) Set argShipChoiceTable.Item(Key) = New clsShipChoice argShipChoiceTable.Item(Key).Carrier = "" argShipChoiceTable.Item(Key).Service = Key argShipChoiceTable.Item(Key).ServiceCode = rsMethods("ShipperCode") argShipChoiceTable.Item(Key).Rate = rsCost("ByQtyCostForMethod" & CInt(rsMethods("ShipperCode"))) argShipChoiceTable.Item(Key).Delivery = "" rsMethods.MoveNext Loop rsMethods.Close : Set rsMethods = Nothing End If rsCost.Close : Set rsCost = Nothing End Sub ' Supports() - Returns TRUE if this gateway has the given (optional) capability Public Function Supports(ByVal argCapability) Supports = False End Function ' Install() - Install this class into eShop. ' - Reserved for future use. Public Sub Install() End Sub ' Dump() - Dump internal class variables for debug. Public Sub Dump() End Sub ' Test() - Class self test. Public Sub Test() End Sub ' Private Functions/Subs ------------------------------------------ End Class ' Register gateway on loading ... Set FeatureInstalled.Item("Rate Gateway:ByQty") = New clsShippingRateByOrderQty %>