[ic] many warehouses shipping

Ed LaFrance interchange-users@interchange.redhat.com
Tue Apr 16 17:38:01 2002


At 03:43 PM 04/16/2002 -0500, you wrote:
>I removed that line from the usertag. But I get this after restarting
>interchange.
>
>...<snip>...
>- - - [16/April/2002:16:58:16 -0500] - - STOP server (19747) on signal TERM
>- - - [16/April/2002:16:58:21 -0500] - - UserTag 'ship' subroutine failed
>compilation:
> >
> >        Global symbol "$origin" requires explicit package name at (eval
>113) line 14, <GLOBAL> line 25.
> >
> > In line 25 of the configuration file 'usertag/ship.tag':
> > UserTag  ship  Routine <<EOR
> >
>- - - [16/April/2002:16:58:21 -0500] - - Interchange V4.8.3
>- - - [16/April/2002:16:58:23 -0500] - - START server (19799) (INET and
>UNIX)
>- - - [16/April/2002:16:58:24 -0500] - - Accepting connections from
>localhost|127\.0\.0\.1
>- - - [16/April/2002:16:58:24 -0500] - - START server (19802) (INET and
>UNIX)
>...<snip>...
>
>User tag now is:
>#########################################################
>UserTag  ship  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;
>}
>

Perhaps the line which you removed was not the only place where $origin 
appears (hint: look approx 10 lines up)?  You can't just chop code out of 
this sub willy-nilly and expect it to work, you need to approach it with 
some understanding of what you are doing. Take a look at the UserTag 
directives at the top of the code, you will see that you are missing a 
variable assignment, based on your parameters list.

- Ed L.


===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================