[ic] many warehouses shipping
Rick Eicher II
interchange-users@interchange.redhat.com
Wed Apr 17 11:12:00 2002
First thanks for the help. Second every one is right I need a better book on
perl.
I did get interchange to start and load the ship.tag with out error. But
when I try it out is says:
1DA: Packages must weigh more than zero pounds.
So there is something wrong with the weights being passed to the ups-query
tag. So I insert a logGlobal statement into the for each loop to try and
debug. So my user tag is:
#######################################
UserTag ship Order mode zip country
UserTag ship Routine <<EOR
sub {
my($mode, $zip, $country) = @_;
$country = $::Values->{$::Variable->{UPS_COUNTRY_FIELD}} if
! $country;
$zip = $::Values->{$::Variable->{UPS_POSTCODE_FIELD}} if
! $zip;
$country = uc $country;
my $shipping = 0;
my %weight;
$weight{$_->{origin}} = $_->{weight} for (@{$Carts->{main}});
foreach (keys %weight){
::logGlobal($weight{$_});
$shipping += $Tag->ups_query({
mode => $mode,
origin => $_,
zip => $zip,
country => $country,
weight => $weight{$_},
});
}
return $shipping;
}
EOR
################################################
After restarting the server and testing the tag the logs show.
....<snip>......
216.111.193.94 gK4fPpgN:216.111.193.94 - [17/April/2002:10:35:22 -0500]
inventory www.e-inventory.biz/cgi-bin/inventory/process.html
216.111.193.94 gK4fPpgN:216.111.193.94 - [17/April/2002:10:35:22 -0500]
inventory www.e-inventory.biz/cgi-bin/inventory/process.html
216.111.193.94 gK4fPpgN:216.111.193.94 - [17/April/2002:10:35:23 -0500]
inventory www.e-inventory.biz/cgi-bin/inventory/process.html
......
But nothing appears for the weight. I did try and put the word "test" in the
logGlobal statement just to make sure the state is running. lol It is.
I added a hidden input to the forms so the weight would be in the cart same
as I did the origin.
I first started useing perl about 6 mounths ago. This code I did not write.
But from what I see it looks right. I sure it is something stupid I have
done.
rick