[ic] many warehouses shipping

Rick Eicher II interchange-users@interchange.redhat.com
Thu Apr 18 12:37:00 2002


> -----Original Message-----
> From: interchange-users-admin@interchange.redhat.com
> [mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of
> Stefan Hornburg (Racke)
> Sent: Thursday, April 18, 2002 10:53 AM
> To: interchange-users@interchange.redhat.com
> Subject: Re: [ic] many warehouses shipping
>
>
> "Rick Eicher II" <rick@pbol.net> writes:
>
>
> [...]
>
> >
> > 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?
>
> AFAIK you need to advise Interchange that these are item modifiers,
> so add "UseModifier origin,weight" to your catalog.cfg.
>
> Ciao
>         Racke
>
After searching the archives for two days I found where mike said the same
thing about 5 mins before i read your email. I have tested it and it works
great. I have changed the user tag some but might go back to the old code.
The old code calls the ups-query tag less times than my new code.

So to make this work I added the following to my catalog.cfg file

	UseModifier origin,weight

And used the following user tag.
##############################
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 $cart = $Carts->{main};
        foreach my $item (@$cart) {
           $shipping += $Tag->ups_query({
               mode => $mode,
               origin => $item->{'origin'},
               zip => $zip,
               country => $country,
               weight => $item->{'weight'},
           });
       }

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

Thanks again to all that helped!!

Rick Eicher II