From 56b137d8c42697ef3d89dcd3412f70b8da1b22ba Mon Sep 17 00:00:00 2001 From: Luc Normandon Date: Mon, 25 Jun 2018 11:49:50 +0200 Subject: [PATCH 1/2] Fixed Get Cart Amount on null bug --- SoColissimo.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; From aff094877ed5652fc3326edbc9937b389e199d82 Mon Sep 17 00:00:00 2001 From: Luc Normandon Date: Mon, 25 Jun 2018 12:12:55 +0200 Subject: [PATCH 2/2] Changed version --- Config/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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