Skip to content

Commit 112ddb4

Browse files
committed
ACP2E-670: Free Shipping Cart Rule for matching items only on Fedex
1 parent cd826aa commit 112ddb4

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

app/code/Magento/Fedex/Model/Carrier.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ protected function _setFreeMethodRequest($freeMethod)
743743
$r = $this->_rawRequest;
744744
$weight = $this->getTotalNumOfBoxes($r->getFreeMethodWeight());
745745
$r->setWeight($weight);
746+
$r->setPackages($this->createPackages((float)$r->getFreeMethodWeight(), []));
746747
$r->setService($freeMethod);
747748
}
748749

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ protected function _setFreeMethodRequest($freeMethod)
523523
$weight = $this->getTotalNumOfBoxes($r->getFreeMethodWeight());
524524
$weight = $this->_getCorrectWeight($weight);
525525
$r->setWeight($weight);
526+
$r->setPackages(
527+
$this->createPackages((float)$r->getFreeMethodWeight(), [])
528+
);
526529
$r->setAction($this->configHelper->getCode('action', 'single'));
527530
$r->setProduct($freeMethod);
528531
}

app/code/Magento/Usps/Model/Carrier.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ protected function _setFreeMethodRequest($freeMethod)
474474
$r->setWeightPounds(floor($weight));
475475
$ounces = ($weight - floor($weight)) * self::OUNCES_POUND;
476476
$r->setWeightOunces(sprintf('%.' . self::$weightPrecision . 'f', $ounces));
477+
$r->setPackages($this->createPackages((float)$r->getFreeMethodWeight(), []));
477478
$r->setService($freeMethod);
478479
}
479480

dev/tests/integration/testsuite/Magento/Usps/Model/CarrierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function testPartialFreeShippingWithCoupon(): void
341341
$this->assertEquals('ALL', $firstRequest->Package->Service);
342342
$this->assertEquals('20', $firstRequest->Package->Pounds);
343343
$this->assertEquals('Priority', $secondRequest->Package->Service);
344-
$this->assertEquals('20', $secondRequest->Package->Pounds);
344+
$this->assertEquals('10', $secondRequest->Package->Pounds);
345345
$price = $this->getShippingMethodAmount($methods, 'usps', '1');
346346
$this->assertEquals(6.70, $price);
347347
}

0 commit comments

Comments
 (0)