Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #59 from thelia-modules/GetCartAmountFix
Browse files Browse the repository at this point in the history
Fixed Get Cart Amount on null bug
  • Loading branch information
gillesbourgeat authored Jun 25, 2018
2 parents 53dab5f + aff0948 commit 4372508
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<descriptive locale="fr_FR">
<title>So Colissimo</title>
</descriptive>
<version>1.4.4</version>
<version>1.4.5</version>
<author>
<name>Thelia</name>
<email>info@thelia.net</email>
Expand Down
12 changes: 8 additions & 4 deletions SoColissimo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4372508

Please sign in to comment.