Fix a bug with shipping costs as a percentage of weight. Build

a test to test the fix.
This commit is contained in:
Colin Kuskie 2008-10-07 22:43:22 +00:00
parent 334ce4791f
commit c0b9bdcc43
3 changed files with 65 additions and 2 deletions

View file

@ -49,7 +49,7 @@ sub calculate {
my $sku = $item->getSku;
if ($sku->isShippingRequired) {
$cost += ($item->get("quantity") * $sku->getPrice * $self->get("percentageOfPrice") / 100) # cost by price
+ ($item->get("quantity") * $sku->getWeight * $self->get("percentageOfWeight") / 100) # cost by weight
+ ($item->get("quantity") * $sku->getWeight * $self->get("pricePerWeight") / 100) # cost by weight
+ ($item->get("quantity") * $self->get("pricePerItem")); # cost by item
$anyShippable = 1;
}