![]() |
|||
I. What does Yamabay Freight Calculator (YFC) do, and why supports VB/ASP?In today's e-Commerce world, being able to access the UPS/Fedex on-line freight quote is essential for a successful e-Commerce Web Site. YFC is a Freight Calculator COM/ActiveX for VB/VBScipts developers. This Freight Calculator not only gets quotes from UPS/Fedex site for you (assuming you have accounts), it also does packing beforehand, based on the Boxes information you provided in an Microsoft Access Database table. II. How to install YFC ?First of all, you can download YFC here . In addition to Yamabay Freight Calculator, there are many other utilities you can download from here too. This zip file contains not just the DLL. It has a sample working VB project (project1.vbp) for your reference. After downloading and unzipping, just run setup.exe to setup the YFC on your computer/server. Do not try run Project.vbp just yet, as there are additional steps you need to do: 2.1 Edit eBPackage.ini file in your Windows direcotry. 2.1.1 First of all, fill in the Shipper's ZIP and the two-letter State Name (AZ stands for Arizona, for example): SHIPPERZIP=12345 SHIPPERSTATE=AZ 2.1.2 If you already have UPS Freight On-Line Access Account, please fill in the following entries: UPSAccessLicenseNumber=0123456789ABCDEF UPSUserID=uuuuuuu UPSPassword=ppppppp 2.1.3 If you already have Fedex Freight On-Line Access Account, and you have already installed Fedex Shipping Manager on this server, then you can get Fedex Rates from YFC, after you fill out the followings: FDXMeterNumber=1234567 FDXAccountNumber=123456789 2.1.4 If you want to make profits from the Freight, here are two entries for you to Markup: FedexMarkUp=1.00 UPSMarkUp=1.00 Please note that 1.00 meaning 100% of the cost, 1.10 mean 110% of the cost, or 10% profit. 2.1.5 Point where the Packaging Info database is: DBFILE=c:\FreightCalc\eBPackage.MDB You may want to edit the table BoxDimTable to put your own boxes dimension there and delete the existing ones. Please note that the unit of Length, Width, and Height are in inches, and the Volume = Length * Width * Height. The Part Number is just a unique text string to represent this box. After you have successfully run this command, you should be able to open the sample project Project1.vbp and run. III. The API of Yamabay Freight Calculaor (YFC) ActiveX/COM3.1 Before you can use YFC, you need to Server.CreateObject in VBScript, or New , in VB: ASP: set fc = Server.CreateObject("eBFreight.FreightCalc") VB: Dim fc As New eBFreight.FreightCalc 3.2 Add Part(s) to the newly created object fc: fc.AddPart "PART1", 10, 10, 10, 5, 1, 10 The example above added a Part called Part1, it is 10 inches long, 10 inches wide and 10 inches height. The weight is 5 lb, the quantity is 1, and the declared value is 10 US dollars. The AddPart method definition: Public Function AddPart(PartNo As String, L As Integer, W As Integer, H As Integer, Weight As Double, Qty As Integer, DecVal As Currency) 3.3 Package Parts by doing: fc.PackParts 3.4 Get rate for different services: Dim rate as currency rate = fc.GetFreightRateBySvcDimZip("UPS GROUND", "CA", 95035, true) The above line gets the freight rate of Service "UPS Ground". The destination state is California (CA), and the destination ZIP is 95035. It is sent to residental area so the last parameter is set to true. The GetFreightRateBySvcDimZip method definition: Function GetFreightRateBySvcDimZip(ByVal Service As String, ByVal State As String, ByVal ZIP As Long, ifRes As Boolean) As Currency Note: The available Services String are: UPS GROUND UPS RED - 1DA 10:30 AM UPS BLUE - 2DA 5:00 PM UPS ORANGE - 3DA 5:00 PM UPS 1DA 8:30 AM FDX PRIORITY - 1DA 10:30 AM FDX ECONOMY - 2DA 4:30 PM FDX FIRST - 1DA 8:00 AM FDX STANDARD - 1DA 3:00 PM 3.5 Optionally get the Response Buffer for debugging purpose: Debug.Print fc.RespBuffer 3.6 Enumerate the used Boxes and Print out the Packaging Information: Dim X As Object Dim Y As Object Debug.Print "Packing Summary: " For Each X In fc.Boxes
Next
|
| Anti Spam | WinASP | Web2Image | Skype Gateway | Dashboard Chart | OE6 COM/ActiveX |
| Copyright © 2000-2006 YamaBay. All rights reserved. Privacy Policy |
|