[ic] many warehouses shipping

Rick Eicher II interchange-users@interchange.redhat.com
Tue Apr 16 12:12:00 2002


I have a usertag that is global:

########################################################
UserTag  ups-query  Order  mode origin zip weight country
UserTag  ship  Routine <<EOR
sub {
        my( $mode, $zip, $weight, $country) = @_;
        $country        = $::Values->{$::Variable->{UPS_COUNTRY_FIELD}}  if
! $country;
        $zip            = $::Values->{$::Variable->{UPS_POSTCODE_FIELD}} if
! $zip;
        $country = uc $country;

        my $shipping = 0;
        my %origins;
        $origins{$_->{origin}} = $_->{weight} for (@{$Carts->{main}});

        foreach (keys %origins){
           $shipping += $Tag->ups_query({
               mode => $_,
               origin => $origin,
               zip => $zip,
               country => $country,
               weight => $origins{$_},
           });
       }

        return $shipping;
}
EOR
#############################

I have origin as a hiden field in the buy now forms. I pull this data from
an added column of the products table.


I call the user tag from my shipping.asc file.

...
1DA     UPS Next Day Air        weight  0       150     f [ship zip="[value
zip]" mode="1DA" weight="@@TOTAL@@"]
...


But when I check out I get:

  Shipping mode '1DA': bad formula. Returning 0.No match found for mode
'1DA', quantity '1',
  returning 0.

If I change the formula to a ups-query tag it works fine, so I believe the
problem is with my tag of with the way I call it.

Any ideas?
Rick Eicher II
www.pbol.net