MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Any idea why this doesn't work?



OK...here is what I've stuck together after looking over Vend/Interpolate.pm.
Still doesn't work, but maybe someone can look at this, and spot my stupidity
(I'm guessing $items{$item->{'weight'}} is incorrect, but don't know what the
proper way to call that is):

In catalog.cfg:

Sub <<EOG
sub calc_item {
        my $totalweight = 0;
        my $surcharge = 0;
        my $quan = 0;
        foreach $item(keys %items) {
                $totalweight = ($totalweight + $items{$item->{'weight'}});
        $quan++;
        }
        $surcharge = ($quan - 1) * ($totalweight * .03);
        return $surcharge;
}
EOG

In shipping.asc (on a single line):

multiitem       Multiple Item Surcharge quantity        0       999999  s      
calc_item       weight

In checkout.html:

<TR><TD>Multiple Item Charge: </TD><TD>[shipping multiitem]</TD></TR>

--
------------------------------------------------------------------------
Brian Knotts                                          bknotts@europa.com
Webmaster/Developer/Portland SysAdmin                     (503) 222-9508
Europa/NWLink                                        Fax: (503) 796-9134



Search for: Match: Format: Sort by: