From 76158efb6415ea9a95605040066d0a35d8bac921 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Sun, 6 Dec 2020 11:12:30 +0100 Subject: [PATCH] Toujours module DHL --- local/modules/DHL/DHL.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)) {