From 9903d3c5da7cc1302ff3115b111546518d162eb8 Mon Sep 17 00:00:00 2001 From: Lewis Voncken Date: Tue, 31 Oct 2017 22:39:10 +0000 Subject: [PATCH 1/2] [BUGFIX] Add FreeShipping to the Items when SalesRule uses FREE_SHIPPING_ADDRESS --- app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php b/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php index c178551ae4584..5afbb19d05cfa 100644 --- a/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php +++ b/app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php @@ -49,6 +49,7 @@ public function processFreeShipping(\Magento\Quote\Model\Quote\Item\AbstractItem case Rule::FREE_SHIPPING_ADDRESS: $address->setFreeShipping(true); + $item->setFreeShipping(true); break; } if ($rule->getStopRulesProcessing()) { From ffcd2ce0c4b457c26dd1ec4c1b867c6a40cb5852 Mon Sep 17 00:00:00 2001 From: Lewis Voncken Date: Sat, 5 May 2018 23:31:14 +0200 Subject: [PATCH 2/2] [TASK] Updated UnitTest according to changes for Free Shipping Cart Rules --- .../Magento/Quote/Model/ShippingMethodManagementTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest.php index 3ad5299a48654..1a56d68bb9eae 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest.php @@ -55,7 +55,8 @@ public function testEstimateByAddressWithCartPriceRuleByShipment() { // Rule applied to entire shipment should not overwrite flat or table rate shipping prices // Only rules applied to specific items should modify those prices (MAGETWO-63844) - $this->executeTestFlow(5, 10); + // The product has free shipping so both prices should be 0 PR#15013 + $this->executeTestFlow(0, 0); } /**