Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 UPS Realtime
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

apswater
VP-CART Super User

444 Posts

Posted - February 02 2005 :  13:58:23  Show Profile  Visit apswater's Homepage  Reply with Quote
ok, I am modifying the UPSrealtime.asp and I have a question.

I ship to both commercial and residential clients and take a batch on the residential ones becase upsrealtime is locked on commercial rates.

on line 157 (or so) I find this

' ** Can be changed to include residential surcharge in the "else" clause, not needed for me.

if fCommercial then

if fCommercial then
str = str & "&RateChart=Regular+Daily+Pickup"
else
str = str & "&RateChart=Regular+Daily+Pickup"
end if

The question! So what code is UPS looking for Residential shipments?

The Else command he is talking about now just repeats the commercial rate language of "&RateChart=Regular+Daily+Pickup"

apswater
VP-CART Super User

444 Posts

Posted - February 02 2005 :  14:05:01  Show Profile  Visit apswater's Homepage  Reply with Quote
Here is another Mod i did on upsrealtime.asp

This adds 20% to the UPS charge to cover the cost boxes, bad addresss charges and residential surcharges UPS sticks up with or simply to make a little extra profit on shipping.

at about line 209 (where you find the const statements)

add :

Dim Price2

then go to line 224 or so and find :

Price=sServices(iCt,cTotalChg)

Change it to :

Price2=sServices(iCt,cTotalChg)
' ** Markup UPS prices here
price=price2 * 1.2
AddServicePrice ServiceType, Price


Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - February 02 2005 :  14:23:41  Show Profile  Visit apswater's Homepage  Reply with Quote
There is also a problem with USA 9 digit Zipcodes. The UPS Realtine will only look up a 5 digit US code.

If someone comes up with somesode to take only the first 5 digit when the country is US would be great.... please post it.. I will if I come up with it. If we dont fix it is gives them a "6836Invalid ConsigneePostalCode" errror which confuses the crap out of them.


Go to Top of Page

dcwebman
VP-CART New User

USA
127 Posts

Posted - March 01 2005 :  18:19:26  Show Profile  Reply with Quote
I just started setting up the UPS realtime so I haven't come across your 9 digit zip code problem but by now you probably have a fix already.

I did find a bug and wanted to share the fix. I had one product in my cart that was 8.6 lbs and when it got to the UPS selection screen, it said the "Total Weight is 8.60000038146973 lbs". Obviously wrong. Fix is in Upsrealtime.asp at Line 322 and make it look like this:
weight=csng(weight)*csng(Prodquantity)

Now you will get correct multiplication.


Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - March 01 2005 :  20:05:07  Show Profile  Visit apswater's Homepage  Reply with Quote
Thanks. Ill patch it.

I did not come up with a fix for the 9 digit. I guess I can make an imput box for the plus zip part and just throw it away. We do a lot of international business so it is hard to trim it since some of these countries have strange codes. I guess it should be easy enough to take the zip and trim it to the left 5 if the country is us but I havnt got to it yet... If you do, please post it here... I did do a mod that takes shipments over 150 lbs and splits them into 50 lb boxes, calcs the freight on 1 box and then multiplies it out to ever how many boxes you would have.... I have to fix it becasue I wrote it early but Ill give it to you if you need it. If you have over 150 lbs total in the order now, the UPSREALTIME crashes.

Go to Top of Page

dcwebman
VP-CART New User

USA
127 Posts

Posted - March 02 2005 :  11:12:17  Show Profile  Reply with Quote
You're right, it was easy to trim the 9 digits to 7 digits if US. In upsrealinterface.asp, right after the Sub GetUPSRates line, add:
if sDestCountry = "US" then
sDestZip = left(sDestZip, 5)
end if

All the products we have are in ounces so I already had to update that file to convert the weights which were in ounces to pounds which UPS wanted. So I don't think I'll need to worry about over 150 lbs. But if I ever see it come up, I'll let you know. Thanks.


Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - March 02 2005 :  14:09:50  Show Profile  Visit apswater's Homepage  Reply with Quote
Thanks!

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00