[ic] UPSE Online, special handling charge, adder

Daniel Browning db at endpoint.com
Fri Aug 21 00:59:38 UTC 2009

On Thursday 20 August 2009 5:43:49 pm DB wrote:
> I finally got around to trying this and it indeed works. Thanks!

You're welcome!

> I'm now wondering how this could be modified to add the
> UPS_OVERSIZED_FEE for each item in the cart 

Here's one (untested) suggestion:

Sub custom_shipping <<EOS
sub {
    my ($final, $mode, $opt, $o) = @_;
    my $additional_fees = 0;
    my $oversized_fee = $Variable->{UPS_OVERSIZED_FEE};
    for my $item (@$Items) {
        next unless $item->{oversized};
        my $quantity = $item->{quantity} || 1;
        my $item_fee = $quantity * $oversized_fee;
        $additional_fees += $item_fee;
    $final += $additional_fees;

    return $final;

Daniel Browning
End Point Corporation

More information about the interchange-users mailing list