MiniVend Akopia Services

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

Getting closer, but still no cigar.



Well, apparenly no one knows the answer to my questions, but I will post my
progress occasionally so that perhaps it may provide some documentation for
someone in the future.

Anyhow, here is what I have now:

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

(changed 
foreach $item (keys %items) 
to 
$item (@{$Safe{items}}) 
and 
$items{$item->{'weight'}} 
to 
$item->{weight}
)

Still no go. I'm guessing maybe there is some configuration issue I'm missing.
Anyone out there? Any ideas?

All I've done outside of this subroutine is add:

multiitem       Multiple Item Charge    quantity        0       999999  s      
calc_item weight

to shipping.asc, and [shipping multiitem] to checkout.html. Is there a step I'm
missing?

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



Search for: Match: Format: Sort by: