[ic] $Tag->shipping and adder problem

Bruno Cantieni bruno at digi-land.com
Wed Feb 14 14:22:07 EST 2007


> Hi all.
> I need to calculate the shipping cost for all the available 
> methods and
> store this in a hash for later use.
> I'm doing this as per the following code (excerpt only):
> [calc]
> #some code here
> 	foreach my $mode (@modes) {
> 		$shipping_hash{'shipmode'}{$mode} = $Tag->shipping_desc(
> $mode );
> 		$shipping_hash{'shipcost'}{$mode} = 
> $Tag->shipping($mode);
> 	}
> #some more code
> return;
> [/calc]
> 
> The cost returned by $Tag->shipping($mode) does not include 
> the "adder" (and
> possibly other modifiers) as defined in shipping.asc
> 
> I checked this also by doing the following (the adder is 2 in 
> this example):
> [calc]return $Tag->shipping('upsg ');[/calc] returns 10.23
> [shipping upsg] returns $12.23
> 
> What gives??
> 
> 
> 
> Bruno Cantieni
> 
Hi again.
I checked this out on a totally different install, on a totally different
server.
Both run 5.2.0
With a upsg method set I get the following results:

A) no minimum, no adder, basic charge $3.02
[calc]return $Tag->shipping('upsg ');[/calc] returns 3.02
[shipping upsg] returns $3.02

B) $5 minimum, no adder, basic charge $3.02
[calc]return $Tag->shipping('upsg ');[/calc] returns 5.00
[shipping upsg] returns $5.00

C) $5 minimum, $5 adder, basic charge $3.02
[calc]return $Tag->shipping('upsg ');[/calc] returns 5.00
[shipping upsg] returns $8.02

D) $5 minimum, $5 adder, basic charge 8.73
[calc]return $Tag->shipping('upsg ');[/calc] returns 8.73
[shipping upsg] returns $13.73

The conclusion:
$Tag->shipping() honours the minimum but not the adder :(
Bug?

Does anybody have an answer to this issue?
Thanks,
Bruno




More information about the interchange-users mailing list