[ic] Multiple Box Shipping - Internal Lookup

Steve interchange-users@icdevgroup.org
Wed Oct 30 07:44:01 2002


Hello,

I am switching from WWW UPS lookups to internal database lookup, and
currently have a routine that splits the weight into 40 lb packages when
over 150 lbs, but the way I understand the call to ups_query is that it will
contact UPS over the web - ups_query is a global user tag. I want to call my
internal database each time instead of depending on UPS web servers.
Any suggestions here?

<snip>
UserTag ship_cost Order weight mode zip
UserTag ship_cost Routine <<EOR
sub {
my($weight,$mode,$zip) = @_;
return unless $weight;
$mode = $Variable->{SHIP_DEFAULT_MODE} unless $mode;
$zip = $Variable->{SHIP_DEFAULT_ZIP} unless $zip;
my $total = 0;
if ($weight < 1)
{ $weight = 1 }
$total = int($weight/145) * $Tag->ups_query( { mode => $mode,zip =>
$zip,weight => 145} );
$total += $Tag->ups_query( { mode => $mode, zip => $zip, weight => $weight %
145 } );
return $total;
}
EOR

The above code works perfectly, btw when calling UPS over the web.

Thanks,
Steve