Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-ASP 6.50 Features and Facilities
 Add Xmerchantsurcharge to uspostalrealtime.asp
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

thinkweb
Starting Member

3 Posts

Posted - March 29 2005 :  17:15:29  Show Profile  Reply with Quote
How can I add more to the dollar amount returned by the USPS, on the upsrealtime.asp you have a Const Xmerchantsurcharge= which will add the extra amount. The shipextracost field in the shipping table of the administration area does not work if I add an extra cost, do you have any ideas?

Thanks,
Frank

Kamin
Starting Member

USA
30 Posts

Posted - May 26 2005 :  15:56:43  Show Profile  Visit Kamin's Homepage  Reply with Quote
This is a simple fix that I did on my site and it works great.

In uspostalrealtime.asp look for this section of code:

Sub FormatMethods
dim i, tempoption, price
dim errors(10),errorcount
shippingcount=0
for i =0 to tempmethodscount-1
Price=Tempprices(i)
tempoption=TempMethods(i)
if Price<>0 then
If getconfig("xLCID")="" Then
TempOption= TempOption & " [" & formatcurrency(Price,2) & "]"
else
TempOption= TempOption & " [" & formatnumber(Price,2) & "]"
end if
ShippingMethods(shippingcount)=TempOption
shippingcount=shippingcount+1
end if
next

and replace with this:

Sub FormatMethods
dim i, tempoption, price
dim errors(10),errorcount
shippingcount=0
for i =0 to tempmethodscount-1
Price=Tempprices(i)
tempoption=TempMethods(i)
if Price<>0 then
If isnumeric(xMerchantsurcharge) then
price=price+xmerchantsurcharge
end if

If getconfig("xLCID")="" Then
TempOption= TempOption & " [" & formatcurrency(Price,2) & "]"
else
TempOption= TempOption & " [" & formatnumber(Price,2) & "]"
end if
ShippingMethods(shippingcount)=TempOption
shippingcount=shippingcount+1
end if
next

Next in your uspostalconfig.asp add this:


' Merchant Surcharge
' The amount to be added to the USPS returned value
Const Xmerchantsurcharge=0


Change Xmerchantsurcharge=0 to the dollar amount you wish to charge over. Example: Xmerchantsurcharge=4 would add $4 over the base shipping charge retried from usps

What i havent been able to figure out is how to do a % surcharge instead of a fixed amount. Any ideas would be helpful.


NOTE: The message board is removing a key charecter from the code i posted. The
price=price+xmerchantsurcharge
should have a plus symbol between price and xmerchantsurcharge with no spaces.

Kamin

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