[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] many warehouses shipping
> >
> This line:
>
> UserTag ship Order mode origin zip weight country
>
> should be a reasonable match this line:
>
> my( $mode, $zip, $weight, $country) = @_;
>
> Change one line or the other, if you want to accurately pass in
> parameters to your UserTag. The variable names don't have to
> match, but you are using $origin, which is clearly missing from
> your list.
>
> I thought the error message was self-explanatory.
lol
Well I have match the lines so my ship tag looks like this
############################################################
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 %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
############################################################################
##
But get the same error.:(
...<snip>...
>
> 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
>
...<snip>...
Any other things to try?
rick