diff --git a/local/modules/DHL/DHL.php b/local/modules/DHL/DHL.php index 21a56808..d94754f6 100644 --- a/local/modules/DHL/DHL.php +++ b/local/modules/DHL/DHL.php @@ -154,10 +154,12 @@ class DHL extends AbstractDeliveryModule ); } - $postageArray = DHLDeliveryPriceQuery::create() - ->findByAreaId($areaId); - $postage = current($postageArray); + $deliveryPrice = DHLDeliveryPriceQuery::create() + ->filterByAreaId($areaId) + ->filterByMaxWeight($weight, Criteria::GREATER_EQUAL) + ->orderByMaxWeight(Criteria::ASC) + ->findOne(); while (prev($areaPrices)) { if ($weight > key($areaPrices)) {