[ic] many warehouses shipping

Rick Eicher II interchange-users@interchange.redhat.com
Thu Apr 18 11:16:01 2002


> I need it to read the weights from the cart and "group" them by
> origin. But
> the line that is suppose to do this does not work. I was
> fortunite enoght to
> be given this code, which is good. the bad part is I have
> understand most of
> my usertag except for this one line of code in question. I have two added
> hidden fields in my cart one for origin the other for weight.
>
> Does anyone know how to do this?
>
> Again here is my user tag that does not work.
> #################################################################
> 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}}); ##Code
> line in question
>
>         foreach (keys %weight){
>               $shipping += $Tag->ups_query({
>                mode => $mode,
>                origin => $_,
>                zip => $zip,
>                country => $country,
>                weight => $weight{$_},
>            });
>        }
>
>         return $shipping;
> }
> EOR
> ##############################################
>
> Thanks for all who have helped,
> Rick Eicher II

After doing some more to this I believe that the weight and origin are not
making it to the cart. I have added a hidden input tag on the flypage and
others. By doeing a view source from browser I see that they are there and
look ok.

...<snip>.....
<FORM ACTION="http://www.e-inventory.biz/cgi-bin/inventory/order.html"
METHOD=POST>
  <INPUT TYPE=hidden  NAME="mv_order_item"  VALUE="100A101-MV-4-B">
  <input type=hidden name=mv_session_id value="Kn5e3egc">
  <input type=hidden name=origin value="48809">
  <input type=hidden name=weight value="1">
...<snip>....

Is this the correct way to add these fields to the cart?

Rick