Skip to content

Commit 5327ddc

Browse files
authored
Calculate Accurate Shipping Cost
The shipping cost wasn't accurate when a shipment contained multiple packages as only the prices from the different packages were compiled, while the cost remained the one returned for a first package.
1 parent 81340cb commit 5327ddc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/code/Magento/Shipping/Model/Rate/PackageResult.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function getAllRates()
6868
throw new \InvalidArgumentException('Same object received from carrier.');
6969
}
7070
$rate->setPrice($rate->getPrice() + $currentRate->getPrice());
71+
$rate->setCost($rate->getCost() + $currentRate->getCost());
7172
continue 2;
7273
}
7374
}

0 commit comments

Comments
 (0)