Index: lib/Vend/Ship.pm =================================================================== RCS file: /var/cvs/interchange/lib/Vend/Ship.pm,v retrieving revision 2.29 diff -u -r2.29 Ship.pm --- lib/Vend/Ship.pm 5 Nov 2008 22:38:52 -0000 2.29 +++ lib/Vend/Ship.pm 16 May 2009 23:35:07 -0000 @@ -774,6 +774,8 @@ logError($error_message); last SHIPIT; } + last SHIPIT unless defined $cost; + last SHIPIT unless ($cost == 0 or $cost > 0); $final += $cost; last SHIPIT unless $o->{continue}; } @@ -914,6 +916,10 @@ $final = $final > $o->{at_least} ? $final : $o->{at_least}; } } + #if($final == undef) { +#::logDebug("XXX undef"); +# return ''; +# } if($opt->{default}) { if(! $opt->{handling}) { $::Values->{mv_shipmode} = $mode; @@ -1090,13 +1096,16 @@ unless (defined $out) { $out = 0; for(@modes) { - $out += shipping($_, $opt) || 0; + my $m = shipping($_, $opt); + $out = $m; } } - $out = Vend::Util::round_to_frac_digits($out); - ## Conversion would have been done above, force to 0, as - ## found by Frederic Steinfels - $out = currency($out, $opt->{noformat}, 0, $opt); + if(defined $out) { + $out = Vend::Util::round_to_frac_digits($out); + ## Conversion would have been done above, force to 0, as + ## found by Frederic Steinfels + $out = currency($out, $opt->{noformat}, 0, $opt); + } } return $out unless $opt->{hide}; return;