diff --git a/Config/module.xml b/Config/module.xml index 9848ed6..4daddf6 100755 --- a/Config/module.xml +++ b/Config/module.xml @@ -7,7 +7,7 @@ So Colissimo - 1.4.4 + 1.4.5 Thelia info@thelia.net diff --git a/SoColissimo.php b/SoColissimo.php index d4ab438..10adbd4 100755 --- a/SoColissimo.php +++ b/SoColissimo.php @@ -150,16 +150,20 @@ public static function getPostageAmount($areaId, $weight, $cartAmount = 0, $deli if ($deliveryModeQuery === 'dom') { $cartAmountDom = SocolissimoAreaFreeshippingDomQuery::create() - ->findOne() - ->getCartAmount(); + ->findOne(); + if ($cartAmountDom) { + $cartAmountDom = $cartAmountDom->getCartAmount(); + } if (null !== $cartAmountDom && $cartAmountDom <= $cartAmount) { $postage = 0; return $postage; } } elseif ($deliveryModeQuery === 'pr') { $cartAmountPr = SocolissimoAreaFreeshippingPrQuery::create() - ->findOne() - ->getCartAmount(); + ->findOne(); + if ($cartAmountPr) { + $cartAmountPr = $cartAmountPr->getCartAmount(); + } if (null !== $cartAmountPr && $cartAmountPr <= $cartAmount) { $postage = 0; return $postage;